chanutil

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanQ

type ChanQ struct {
	// contains filtered or unexported fields
}

Flexible channel queue (no fixed length). Note: consider using syncutil.* instead.

func NewChanQ

func NewChanQ(inSize, outSize int) *ChanQ

func (*ChanQ) In

func (ch *ChanQ) In() chan<- any

func (*ChanQ) Out

func (ch *ChanQ) Out() <-chan any

type NBChan

type NBChan struct {
	LogString string
	// contains filtered or unexported fields
}

Non-blocking channel. Note: consider using syncutil.* instead.

func NewNBChan

func NewNBChan() *NBChan

func NewNBChan2 added in v1.1.0

func NewNBChan2(n int, logS string) *NBChan

func (*NBChan) NewBufChan

func (ch *NBChan) NewBufChan(n int)

func (*NBChan) Receive

func (ch *NBChan) Receive(timeout time.Duration) (any, error)

Receives or fails after timeout.

func (*NBChan) Send

func (ch *NBChan) Send(v any) error

Send now if a receiver is watching, or fails (non-blocking) with error.

func (*NBChan) SetBufChanToZero added in v1.1.0

func (ch *NBChan) SetBufChanToZero()

Setting the channel to zero allows a send to fail immediatly if there is no receiver waiting.

Jump to

Keyboard shortcuts

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