Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChannelFull = errors.Wrap(ErrSendFailed, "channel is full")
View Source
var ErrSendFailed = errors.New("send failed")
Functions ¶
This section is empty.
Types ¶
type ChannelStream ¶
type ChannelStream[T any] struct { // contains filtered or unexported fields }
func (ChannelStream[T]) Channel ¶
func (c ChannelStream[T]) Channel() <-chan T
func (ChannelStream[T]) Next ¶
func (c ChannelStream[T]) Next(ctx context.Context) (message T, hasNext bool, err error)
func (ChannelStream[T]) Unsubscribe ¶
func (c ChannelStream[T]) Unsubscribe()
type Topic ¶
type Topic[T any] struct { // contains filtered or unexported fields }
func NewTopic ¶
NewTopic returns a new instance of Topic WARNING: This is intended for testing only This Topic does not support multiple subscribers
func (*Topic[T]) Publish ¶
Publish sends a message to the given topic. If the topic doesn't exist it and a matching channel will be created.
func (*Topic[T]) Subscribe ¶
Subscribe returns a channel that will receive messages published to the given topic. WARNING: This is intended for testing only This Topic does not support multiple subscribers Messages will be consumed by the first subscriber If multiple subscribers receive the stream messages will be load balanced by Go channel consumption semantics
Click to show internal directories.
Click to hide internal directories.