Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotifierFunc ¶
type NotifierFunc[NotificationT any] func(ctx context.Context, ss *SubscriptionSet[NotificationT])
type Subscription ¶
type Subscription[NotificationT any] struct { Handle HandleT // contains filtered or unexported fields }
func NewSubscription ¶
func NewSubscription[NotificationT any](owner *SubscriptionSet[NotificationT], sink chan<- NotificationT) *Subscription[NotificationT]
func (*Subscription[NotificationT]) Cancel ¶
func (es *Subscription[NotificationT]) Cancel()
func (*Subscription[NotificationT]) Cancelled ¶
func (es *Subscription[NotificationT]) Cancelled() bool
func (*Subscription[NotificationT]) Notify ¶
func (es *Subscription[NotificationT]) Notify(n NotificationT)
type SubscriptionSet ¶
type SubscriptionSet[NotificationT any] struct { // contains filtered or unexported fields }
The subscription set helps manage a set of subscriptions that share the same source of notifications.
func NewSubscriptionSet ¶
func NewSubscriptionSet[NotificationT any](notifierFunc NotifierFunc[NotificationT], parentCtx context.Context) *SubscriptionSet[NotificationT]
func (*SubscriptionSet[NotificationT]) CancelAll ¶
func (ss *SubscriptionSet[NotificationT]) CancelAll()
func (*SubscriptionSet[NotificationT]) Notify ¶
func (ss *SubscriptionSet[NotificationT]) Notify(n NotificationT)
func (*SubscriptionSet[NotificationT]) Subscribe ¶
func (ss *SubscriptionSet[NotificationT]) Subscribe(sink chan<- NotificationT) *Subscription[NotificationT]
Click to show internal directories.
Click to hide internal directories.