Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel[T any] struct { Chan <-chan T // contains filtered or unexported fields }
Channel represents a receiving channel.
type ChannelBroker ¶
type ChannelBroker[T any] struct { Chan chan<- T // contains filtered or unexported fields }
ChannelBroker represents the broker.
func (*ChannelBroker[T]) Clear ¶ added in v0.2.0
func (cb *ChannelBroker[T]) Clear()
Clear closes and removes all channels from broker
func (*ChannelBroker[T]) NewChannel ¶
func (cb *ChannelBroker[T]) NewChannel() *Channel[T]
NewChannel creates new receiving Channel and adds it to the broker
func (*ChannelBroker[T]) RemoveChannel ¶
func (cb *ChannelBroker[T]) RemoveChannel(c *Channel[T])
RemoveChannel from broker and closes the containing channel.
Channel object should not be further used after removing it from broker, because the unlaying channel is closed after this call.
Click to show internal directories.
Click to hide internal directories.