chanutil

package
v2.0.0-...-7f6935a Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 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<- interface{}

func (*ChanQ) Out

func (ch *ChanQ) Out() <-chan interface{}

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

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) (interface{}, error)

Receives or fails after timeout.

func (*NBChan) Send

func (ch *NBChan) Send(v interface{}) error

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

func (*NBChan) SetBufChanToZero

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