Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSubscriptionManagerClosed = fmt.Errorf("subscription manager closed")
Functions ¶
func SplitByBatchProcess ¶
func SplitByBatchProcess[TItem any](values <-chan TItem, maxItems int, maxTimeout time.Duration) <-chan []TItem
SplitByBatchProcess batch processor that will split a channel into batches of a maximum size or after a maximum timeout. main idea from https://elliotchance.medium.com/batch-a-channel-by-size-or-time-in-go-92fa3098f65
Types ¶
type SubscriptionManager ¶
type SubscriptionManager[T any] struct { // contains filtered or unexported fields }
func NewSubscriptionManager ¶
func NewSubscriptionManager[T any](logger *logger.Logger, shutdownCloser *graceful.ShutdownCloser) *SubscriptionManager[T]
func (*SubscriptionManager[T]) AddSubscriber ¶
func (manager *SubscriptionManager[T]) AddSubscriber(ctx context.Context, uniqSubscriberId string) (chan []T, error)
func (*SubscriptionManager[T]) Close ¶
func (manager *SubscriptionManager[T]) Close() error
func (*SubscriptionManager[T]) Notify ¶
func (manager *SubscriptionManager[T]) Notify(events ...T)
func (*SubscriptionManager[T]) RemoveSubscriber ¶
func (manager *SubscriptionManager[T]) RemoveSubscriber(key string)
Click to show internal directories.
Click to hide internal directories.