Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IterContext ¶
func IterContext[T any](ctx context.Context, ch <-chan T) iter.Seq[T]
IterContext returns an iterator that iterates over the channel until the channel is closed or the context cancelled.
Check ctx.Err() != nil to detect if the context was cancelled.
Types ¶
type Notifier ¶ added in v0.421.0
type Notifier struct {
// contains filtered or unexported fields
}
Notifier helps to notify multiple subscribers that an event has occurred.
Unlike pubsub.Topic, notifier drops messages if the subscribers are not processing them fast enough. As the messages do not carry payload, we are safe to do so.
func NewNotifier ¶ added in v0.421.0
func NewNotifier(ctx context.Context) *Notifier
NewNotifier creates a new Notifier instance.
The returned Notifier will automatically close all subscribers when the context is cancelled.
Click to show internal directories.
Click to hide internal directories.