Documentation ¶
Index ¶
- func Bridge(done <-chan struct{}, chanStream <-chan <-chan interface{}) <-chan interface{}
- func Duplicate(done <-chan struct{}, in <-chan interface{}) (<-chan interface{}, <-chan interface{})
- func FanIn(done <-chan struct{}, channels ...<-chan interface{}) <-chan interface{}
- func FanOut(done <-chan struct{}, ...) []<-chan interface{}
- func Or(dones ...<-chan struct{}) <-chan struct{}
- func OrDone(done <-chan struct{}, stream <-chan interface{}) <-chan interface{}
- func Repeat(done <-chan struct{}, fn func() interface{}) <-chan interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bridge ¶
func Bridge( done <-chan struct{}, chanStream <-chan <-chan interface{}, ) <-chan interface{}
Bridge 用于连接多个通道
func Duplicate ¶
func Duplicate( done <-chan struct{}, in <-chan interface{}, ) (<-chan interface{}, <-chan interface{})
Duplicate 把 in 通道复制成两份。
func FanIn ¶
func FanIn( done <-chan struct{}, channels ...<-chan interface{}, ) <-chan interface{}
FanIn make multi-channels to one NOTICE: FanIn 合并作的时候,很有可能会打乱 stream 中工作的顺序
func FanOut ¶
func FanOut( done <-chan struct{}, worker func(<-chan struct{}, <-chan interface{}) <-chan interface{}, stream <-chan interface{}, num int, ) []<-chan interface{}
FanOut make multi-workers to parallely do the work NOTICE: FanOut 分配工作的时候,很有可能会打乱 stream 中工作的顺序
func Or ¶
func Or(dones ...<-chan struct{}) <-chan struct{}
Or return a DONE channel The DONE channel will be closed if any one of dones is closed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.