chans

package
v0.0.0-test-multiarch Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout = errors.New("timeout waiting for chan")
	ErrClosed  = errors.New("chan closed")
	ErrOpen    = errors.New("chan open")
)

Functions

func IsClosedWithin

func IsClosedWithin[T any](ch <-chan T, wait time.Duration) error

func IsEmptyWithin

func IsEmptyWithin[T any](src <-chan T, wait time.Duration) error

func RecvContext

func RecvContext[T any](ctx context.Context, c <-chan T) (T, error)

RecvContext receives from c unless ctx is Done.

func RecvWithin

func RecvWithin[T any](src <-chan T, wait time.Duration) (T, error)

func SendContext

func SendContext[T any](ctx context.Context, c chan<- T, v T) error

SendContext sends v on c unless ctx is Done.

func SendWithin

func SendWithin[T any](dest chan<- T, value T, wait time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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