Documentation
¶
Index ¶
- func Bridge[T any](ctx context.Context, chanStream <-chan <-chan T) <-chan T
- func FanIn[T any](ctx context.Context, streams ...<-chan T) <-chan T
- func Or[T any](channels ...<-chan T) <-chan T
- func OrDone[T any](ctx context.Context, c <-chan T) <-chan T
- func Repeat[T any](ctx context.Context, values ...T) <-chan T
- func RepeatFn[T any](ctx context.Context, fn func() T) <-chan T
- func Shuffle[T any](ctx context.Context, in chan T, targetDistance int) <-chan T
- func Take[T any](ctx context.Context, valueStream <-chan T, num int) <-chan T
- func Tee[T any](ctx context.Context, in <-chan T) (_, _ <-chan T)
- type SzError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Or ¶ added in v0.0.1
func Or[T any](channels ...<-chan T) <-chan T
Or returns a channel that combines all the specified channels.
func OrDone ¶
OrDone encapsulates the for-select idiom used for many goroutines the idea is that it makes the code easier to read
func Shuffle ¶ added in v0.0.5
Shuffle items coming through a channel. input a channel of items to be shuffled. output a channel of shuffled items. target distance is how, on average, far each item should move. there's no guarantee that a particular item will move that far, but it is used as general guidance. Beware: This function incurs a 1μs per item performance hit.
Types ¶
Click to show internal directories.
Click to hide internal directories.