broadcaster

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

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 New added in v0.6.0

func New[T any](ctx context.Context) *Broadcaster[T]

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

type Listener

type Listener[T any] struct {
	C <-chan T
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL