Documentation ¶
Index ¶
- func FanInRec(channels ...<-chan interface{}) <-chan interface{}
- func FanOut(in <-chan interface{}, out []chan interface{}, async bool)
- func MapChan(in <-chan interface{}, fn func(interface{}) interface{}) <-chan interface{}
- func MergeChannel(a, b <-chan interface{}) <-chan interface{}
- func OrDone(channels ...<-chan interface{}) <-chan interface{}
- func Orderly(tasks []*OrderlyTask)
- func Pipeline(in chan interface{}) <-chan interface{}
- func ReduceChan(in <-chan interface{}, fn func(r, v interface{}) interface{}) interface{}
- func SkipFn(ctx context.Context, valueStream <-chan interface{}, ...) <-chan interface{}
- func SkipN(ctx context.Context, valueStream <-chan interface{}, num int) <-chan interface{}
- func SkipWhile(ctx context.Context, valueStream <-chan interface{}, ...) <-chan interface{}
- func Stream(ctx context.Context, values ...interface{}) <-chan interface{}
- func TaskFn(ctx context.Context, valueStream <-chan interface{}, ...) <-chan interface{}
- func TaskN(ctx context.Context, valueStream <-chan interface{}, num int) <-chan interface{}
- func TaskWhile(ctx context.Context, valueStream <-chan interface{}, ...) <-chan interface{}
- type OrderlyTask
- type WaitGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapChan ¶
func MapChan(in <-chan interface{}, fn func(interface{}) interface{}) <-chan interface{}
func MergeChannel ¶
func MergeChannel(a, b <-chan interface{}) <-chan interface{}
MergeChannel 合并两个channel
func ReduceChan ¶
func ReduceChan(in <-chan interface{}, fn func(r, v interface{}) interface{}) interface{}
func SkipFn ¶
func SkipFn(ctx context.Context, valueStream <-chan interface{}, fn func(v interface{}) bool) <-chan interface{}
SkipFn 跳过满足条件的数据
func SkipWhile ¶
func SkipWhile(ctx context.Context, valueStream <-chan interface{}, fn func(v interface{}) bool) <-chan interface{}
SkipWhile 跳过满足条件的数据,一旦不满足,当前这个元素以后的元素都会输出
func TaskFn ¶
func TaskFn(ctx context.Context, valueStream <-chan interface{}, fn func(v interface{}) bool) <-chan interface{}
TaskFn 筛选流中的数据,只保留满足条件的数据
Types ¶
type OrderlyTask ¶
Click to show internal directories.
Click to hide internal directories.