chanUtil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLongerReceive = errors.New("receiver no longer receives value from channel")
	ErrFullChan        = errors.New("channel is full")
	ErrEmptyChan       = errors.New("channel is empty")
)

Functions

This section is empty.

Types

type Chan1Sender1Receiver

type Chan1Sender1Receiver interface {
	TrySend(val interface{}) error           // 尝试发送
	Send(val interface{})                    // 接收
	StopSend()                               // 发送方停止发送
	TryReceive() (interface{}, error)        // 尝试接收
	Receive() interface{}                    // 接收 v := <-c
	ReceiveWithBoolean() (interface{}, bool) // 接收 v, ok := <-c
	StopReceive()                            // 接收方停止接收
	Range(func(val interface{}) bool)        // for-range语法 类似于sync.Map.Range
}

func NewDefaultChan1Sender1Receiver

func NewDefaultChan1Sender1Receiver(size uint) Chan1Sender1Receiver

Jump to

Keyboard shortcuts

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