Documentation ¶
Overview ¶
Package cpr contains concurrency primitives.
Index ¶
- func Demultiplex[T any](inChs ...<-chan T) chan T
- func FanIn[T any](f func(context.Context, chan<- T) error) (<-chan T, func(context.Context) error)
- func ForAll[T any](ts []T, f func(T)) func()
- func ForEach[T any](ctx context.Context, ch <-chan T, f func(T) error) error
- func Parallel(fs ...func()) func()
- func Pop[T any](ctx context.Context, ch <-chan T) (T, bool, error)
- func Produce[T any](f func(context.Context, chan<- T) error) (<-chan T, func(context.Context) error)
- func Push[T any](ctx context.Context, ch chan<- T, ts ...T) error
- func Seq[T any](ctx context.Context, ts []T, fs ...func(T) error) ([]T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Demultiplex ¶
func Demultiplex[T any](inChs ...<-chan T) chan T
Demultiplex demultiplexes the given channels.
func Pop ¶
Pop returns a new T from the ch. It returns a boolean which indicates whether the channel is still open. The error indicates whether the context has been canceled.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.