Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Topic ¶
type Topic[T any] struct { // contains filtered or unexported fields }
func (*Topic[T]) Subscribe ¶
func (s *Topic[T]) Subscribe(c chan T) chan T
Subscribe a channel to the topic.
The channel will be closed when the topic is closed.
func (*Topic[T]) Unsubscribe ¶
func (s *Topic[T]) Unsubscribe(c chan T)
Unsubscribe a channel from the topic, closing the channel.
Click to show internal directories.
Click to hide internal directories.