Documentation
¶
Index ¶
- Variables
- type Broadcaster
- func (b *Broadcaster[T]) IsStopped() bool
- func (b *Broadcaster[T]) IsSubscribed(l *Listener[T]) (bool, error)
- func (b *Broadcaster[T]) Start()
- func (b *Broadcaster[T]) Stop() error
- func (b *Broadcaster[T]) Subscribe() (*Listener[T], error)
- func (b *Broadcaster[T]) Unsubscribe(l *Listener[T]) error
- func (b *Broadcaster[T]) Write(t T) error
- func (b *Broadcaster[T]) WriteSync(t T) error
- type Listener
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStopped = errors.New("broadcaster is stopped")
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster[T any] struct { // contains filtered or unexported fields }
func NewAndStart ¶ added in v0.6.0
func NewAndStart[T any](ctx context.Context) *Broadcaster[T]
func (*Broadcaster[T]) IsStopped ¶
func (b *Broadcaster[T]) IsStopped() bool
func (*Broadcaster[T]) IsSubscribed ¶
func (b *Broadcaster[T]) IsSubscribed(l *Listener[T]) (bool, error)
func (*Broadcaster[T]) Start ¶ added in v0.6.0
func (b *Broadcaster[T]) Start()
func (*Broadcaster[T]) Stop ¶
func (b *Broadcaster[T]) Stop() error
func (*Broadcaster[T]) Subscribe ¶
func (b *Broadcaster[T]) Subscribe() (*Listener[T], error)
func (*Broadcaster[T]) Unsubscribe ¶
func (b *Broadcaster[T]) Unsubscribe(l *Listener[T]) error
func (*Broadcaster[T]) Write ¶
func (b *Broadcaster[T]) Write(t T) error
func (*Broadcaster[T]) WriteSync ¶
func (b *Broadcaster[T]) WriteSync(t T) error
Click to show internal directories.
Click to hide internal directories.