Documentation ¶
Index ¶
- Constants
- func AnySDaisy(inp <-chan []interface{}, tube AnySTube) (out <-chan []interface{})
- func AnySDaisyChain(inp <-chan []interface{}, tubes ...AnySTube) (out <-chan []interface{})
- func Chan(inp ...interface{}) (out <-chan interface{})
- func ChanAnyS(inp ...[]interface{}) (out <-chan []interface{})
- func ChanAnySFuncErr(act func() ([]interface{}, error)) (out <-chan []interface{})
- func ChanAnySFuncNok(act func() ([]interface{}, bool)) (out <-chan []interface{})
- func ChanAnySSlice(inp ...[][]interface{}) (out <-chan []interface{})
- func ChanFuncErr(act func() (interface{}, error)) (out <-chan interface{})
- func ChanFuncNok(act func() (interface{}, bool)) (out <-chan interface{})
- func ChanSlice(inp ...[]interface{}) (out <-chan interface{})
- func Daisy(inp <-chan interface{}, tube Tube) (out <-chan interface{})
- func DaisyChain(inp <-chan interface{}, tubes ...Tube) (out <-chan interface{})
- func Done(inp <-chan interface{}) (done <-chan struct{})
- func DoneAnyS(inp <-chan []interface{}) (done <-chan struct{})
- func DoneAnySFunc(inp <-chan []interface{}, act func(a []interface{})) (out <-chan struct{})
- func DoneAnySSlice(inp <-chan []interface{}) (done <-chan [][]interface{})
- func DoneFunc(inp <-chan interface{}, act func(a interface{})) (out <-chan struct{})
- func DoneSlice(inp <-chan interface{}) (done <-chan []interface{})
- func Join(out chan<- interface{}, inp ...interface{}) (done <-chan struct{})
- func JoinAnyS(out chan<- []interface{}, inp ...[]interface{}) (done <-chan struct{})
- func JoinAnySChan(out chan<- []interface{}, inp <-chan []interface{}) (done <-chan struct{})
- func JoinAnySSlice(out chan<- []interface{}, inp ...[][]interface{}) (done <-chan struct{})
- func JoinChan(out chan<- interface{}, inp <-chan interface{}) (done <-chan struct{})
- func JoinSlice(out chan<- interface{}, inp ...[]interface{}) (done <-chan struct{})
- func MakeAnySChan() (out chan []interface{})
- func MakeChan() (out chan interface{})
- func PipeAnySBuffer(inp <-chan []interface{}, cap int) (out <-chan []interface{})
- func PipeAnySFork(inp <-chan []interface{}) (out1, out2 <-chan []interface{})
- func PipeAnySFunc(inp <-chan []interface{}, act func(a []interface{}) []interface{}) (out <-chan []interface{})
- func PipeBuffer(inp <-chan interface{}, cap int) (out <-chan interface{})
- func PipeFork(inp <-chan interface{}) (out1, out2 <-chan interface{})
- func PipeFunc(inp <-chan interface{}, act func(a interface{}) interface{}) (out <-chan interface{})
- func SendProxy(out chan<- interface{}) chan<- interface{}
- func SendProxyAnyS(out chan<- []interface{}) chan<- []interface{}
- type AnySTube
- type Tube
Constants ¶
const AnySCAP = 10
AnySCAP is the capacity of the buffered proxy channel
const AnySQUE = 16
AnySQUE is the allocated size of the circular queue
const CAP = 10
CAP is the capacity of the buffered proxy channel
const QUE = 16
QUE is the allocated size of the circular queue
Variables ¶
This section is empty.
Functions ¶
func AnySDaisy ¶
func AnySDaisy(inp <-chan []interface{}, tube AnySTube) (out <-chan []interface{})
AnySDaisy returns a channel to receive all inp after having passed thru tube.
func AnySDaisyChain ¶
func AnySDaisyChain(inp <-chan []interface{}, tubes ...AnySTube) (out <-chan []interface{})
AnySDaisyChain returns a channel to receive all inp after having passed thru all tubes.
func Chan ¶
func Chan(inp ...interface{}) (out <-chan interface{})
Chan returns a channel to receive all inputs before close.
func ChanAnyS ¶
func ChanAnyS(inp ...[]interface{}) (out <-chan []interface{})
ChanAnyS returns a channel to receive all inputs before close.
func ChanAnySFuncErr ¶
func ChanAnySFuncErr(act func() ([]interface{}, error)) (out <-chan []interface{})
ChanAnySFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanAnySFuncNok ¶
func ChanAnySFuncNok(act func() ([]interface{}, bool)) (out <-chan []interface{})
ChanAnySFuncNok returns a channel to receive all results of act until nok before close.
func ChanAnySSlice ¶
func ChanAnySSlice(inp ...[][]interface{}) (out <-chan []interface{})
ChanAnySSlice returns a channel to receive all inputs before close.
func ChanFuncErr ¶
func ChanFuncErr(act func() (interface{}, error)) (out <-chan interface{})
ChanFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanFuncNok ¶
func ChanFuncNok(act func() (interface{}, bool)) (out <-chan interface{})
ChanFuncNok returns a channel to receive all results of act until nok before close.
func ChanSlice ¶
func ChanSlice(inp ...[]interface{}) (out <-chan interface{})
ChanSlice returns a channel to receive all inputs before close.
func Daisy ¶
func Daisy(inp <-chan interface{}, tube Tube) (out <-chan interface{})
Daisy returns a channel to receive all inp after having passed thru tube.
func DaisyChain ¶
func DaisyChain(inp <-chan interface{}, tubes ...Tube) (out <-chan interface{})
DaisyChain returns a channel to receive all inp after having passed thru all tubes.
func Done ¶
func Done(inp <-chan interface{}) (done <-chan struct{})
Done returns a channel to receive one signal before close after inp has been drained.
func DoneAnyS ¶
func DoneAnyS(inp <-chan []interface{}) (done <-chan struct{})
DoneAnyS returns a channel to receive one signal before close after inp has been drained.
func DoneAnySFunc ¶
func DoneAnySFunc(inp <-chan []interface{}, act func(a []interface{})) (out <-chan struct{})
DoneAnySFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneAnySSlice ¶
func DoneAnySSlice(inp <-chan []interface{}) (done <-chan [][]interface{})
DoneAnySSlice returns a channel which will receive a slice of all the AnySs received on inp channel before close. Unlike DoneAnyS, a full slice is sent once, not just an event.
func DoneFunc ¶
func DoneFunc(inp <-chan interface{}, act func(a interface{})) (out <-chan struct{})
DoneFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneSlice ¶
func DoneSlice(inp <-chan interface{}) (done <-chan []interface{})
DoneSlice returns a channel which will receive a slice of all the s received on inp channel before close. Unlike Done, a full slice is sent once, not just an event.
func Join ¶
func Join(out chan<- interface{}, inp ...interface{}) (done <-chan struct{})
Join sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinAnyS ¶
func JoinAnyS(out chan<- []interface{}, inp ...[]interface{}) (done <-chan struct{})
JoinAnyS sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinAnySChan ¶
func JoinAnySChan(out chan<- []interface{}, inp <-chan []interface{}) (done <-chan struct{})
JoinAnySChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinAnySSlice ¶
func JoinAnySSlice(out chan<- []interface{}, inp ...[][]interface{}) (done <-chan struct{})
JoinAnySSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinChan ¶
func JoinChan(out chan<- interface{}, inp <-chan interface{}) (done <-chan struct{})
JoinChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinSlice ¶
func JoinSlice(out chan<- interface{}, inp ...[]interface{}) (done <-chan struct{})
JoinSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func MakeAnySChan ¶
func MakeAnySChan() (out chan []interface{})
MakeAnySChan returns a new open channel (simply a 'chan []interface{}' that is).
Note: No 'AnyS-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myAnySPipelineStartsHere := MakeAnySChan() // ... lot's of code to design and build Your favourite "myAnySWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myAnySPipelineStartsHere <- drop } close(myAnySPipelineStartsHere)
Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)
Note: as always (except for PipeAnySBuffer) the channel is unbuffered.
func MakeChan ¶
func MakeChan() (out chan interface{})
MakeChan returns a new open channel (simply a 'chan interface{}' that is).
Note: No '-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myPipelineStartsHere := MakeChan() // ... lot's of code to design and build Your favourite "myWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myPipelineStartsHere <- drop } close(myPipelineStartsHere)
Hint: especially helpful, if Your piping library operates on some hidden (non-exported) type (or on a type imported from elsewhere - and You don't want/need or should(!) have to care.)
Note: as always (except for PipeBuffer) the channel is unbuffered.
func PipeAnySBuffer ¶
func PipeAnySBuffer(inp <-chan []interface{}, cap int) (out <-chan []interface{})
PipeAnySBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeAnySFork ¶
func PipeAnySFork(inp <-chan []interface{}) (out1, out2 <-chan []interface{})
PipeAnySFork returns two channels to receive every result of inp before close.
Note: Yes, it is a VERY simple fanout - but sometimes all You need.
func PipeAnySFunc ¶
func PipeAnySFunc(inp <-chan []interface{}, act func(a []interface{}) []interface{}) (out <-chan []interface{})
PipeAnySFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeAnySMap for functional people, but 'map' has a very different meaning in go lang.
func PipeBuffer ¶
func PipeBuffer(inp <-chan interface{}, cap int) (out <-chan interface{})
PipeBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeFork ¶
func PipeFork(inp <-chan interface{}) (out1, out2 <-chan interface{})
PipeFork returns two channels to receive every result of inp before close.
Note: Yes, it is a VERY simple fanout - but sometimes all You need.
func PipeFunc ¶
func PipeFunc(inp <-chan interface{}, act func(a interface{}) interface{}) (out <-chan interface{})
PipeFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeMap for functional people, but 'map' has a very different meaning in go lang.
func SendProxy ¶
func SendProxy(out chan<- interface{}) chan<- interface{}
SendProxy returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.
Note: the expanding buffer is implemented via "container/ring"
func SendProxyAnyS ¶
func SendProxyAnyS(out chan<- []interface{}) chan<- []interface{}
SendProxyAnyS returns a channel to serve as a sending proxy to 'out'. Uses a goroutine to receive values from 'out' and store them in an expanding buffer, so that sending to 'out' never blocks.
Note: the expanding buffer is implemented via "container/ring"