channels

package
v0.0.0-...-e8da0a6 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

func Subscribe(fanout *Fanout, sub ...*SafeChannel)

func Unsubscribe

func Unsubscribe(fanout *Fanout, sub ...*SafeChannel)

Types

type Fanout

type Fanout struct {
	sync.Once
	sync.Mutex
	// contains filtered or unexported fields
}

func NewFanout

func NewFanout(pub *SafeChannel) *Fanout

func (*Fanout) NewSubscriber

func (fanout *Fanout) NewSubscriber(size ...int) *SafeChannel

func (*Fanout) Start

func (fanout *Fanout) Start()

func (*Fanout) Stop

func (fanout *Fanout) Stop()

func (*Fanout) SubChan

func (fanout *Fanout) SubChan() <-chan *SafeChannel

func (*Fanout) Subscribe

func (fanout *Fanout) Subscribe(sub ...*SafeChannel)

func (*Fanout) Unsubscribe

func (fanout *Fanout) Unsubscribe(sub *SafeChannel)

type SafeChannel

type SafeChannel struct {
	C chan T
	// contains filtered or unexported fields
}

func NewSafeChannel

func NewSafeChannel(size ...int) *SafeChannel

func WrapSafeChannel

func WrapSafeChannel(c chan T) *SafeChannel

func (*SafeChannel) IsClosed

func (me *SafeChannel) IsClosed() bool

func (*SafeChannel) SafeClose

func (me *SafeChannel) SafeClose()

func (*SafeChannel) SafeSend

func (me *SafeChannel) SafeSend(value T) bool

type T

type T interface{}

Jump to

Keyboard shortcuts

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