Documentation ¶
Index ¶
- func Copy[T any](ctx context.Context, input <-chan T, output ...chan<- T)
- func Equal[T cmp.Ordered](ctx context.Context, c <-chan T, value T) <-chan T
- func Filter[T any](ctx context.Context, c <-chan T, f func(T) bool) <-chan T
- func Greater[T cmp.Ordered](ctx context.Context, c <-chan T, value T) <-chan T
- func GreaterOrEqual[T cmp.Ordered](ctx context.Context, c <-chan T, value T) <-chan T
- func Less[T cmp.Ordered](ctx context.Context, c <-chan T, value T) <-chan T
- func LessOrEqual[T cmp.Ordered](ctx context.Context, c <-chan T, value T) <-chan T
- func Make[T any](ctx context.Context, f func() (T, bool)) chan T
- func Merge[T any](ctx context.Context, input ...<-chan T) <-chan T
- func NotEqual[T cmp.Ordered](ctx context.Context, c <-chan T, value T) <-chan T
- func Pool[T, R any](ctx context.Context, c <-chan T, size int, f Func[T, R]) <-chan Result[R]
- func Split[T any](ctx context.Context, input <-chan T, output ...chan<- T)
- func Tee[T any](ctx context.Context, c chan T) (chan T, chan T)
- func Worker[T, R any](ctx context.Context, c <-chan T, f Func[T, R], res chan<- Result[R])
- type Func
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy reads from the input channel and sends messages to all of the output channels. The output channels are closed when the input channel is closed or when the context is cancelled.
func GreaterOrEqual ¶
func LessOrEqual ¶
func Merge ¶
Merge returns all the messages from the given input channels on a single channel. The output channel is closed when all of the input channels are closed or when the context is cancelled.
func Pool ¶
Pool spawns size workers to processes messages on c using f, returning the results in a channel. The resulting channel must be read until it is closed or the process will hang.
Types ¶
Click to show internal directories.
Click to hide internal directories.