Documentation ¶
Index ¶
- Constants
- func ChanDot(inp ...*dot.Dot) (out <-chan *dot.Dot)
- func ChanDotFuncErr(act func() (*dot.Dot, error)) (out <-chan *dot.Dot)
- func ChanDotFuncNil(act func() *dot.Dot) (out <-chan *dot.Dot)
- func ChanDotFuncNok(act func() (*dot.Dot, bool)) (out <-chan *dot.Dot)
- func ChanDotSlice(inp ...[]*dot.Dot) (out <-chan *dot.Dot)
- func DoneDot(inp <-chan *dot.Dot) (done <-chan struct{})
- func DoneDotFunc(inp <-chan *dot.Dot, act func(a *dot.Dot)) (out <-chan struct{})
- func DoneDotSlice(inp <-chan *dot.Dot) (done <-chan []*dot.Dot)
- func DotDaisy(inp <-chan *dot.Dot, tube DotTube) (out <-chan *dot.Dot)
- func DotDaisyChain(inp <-chan *dot.Dot, tubes ...DotTube) (out <-chan *dot.Dot)
- func JoinDot(out chan<- *dot.Dot, inp ...*dot.Dot) (done <-chan struct{})
- func JoinDotChan(out chan<- *dot.Dot, inp <-chan *dot.Dot) (done <-chan struct{})
- func JoinDotSlice(out chan<- *dot.Dot, inp ...[]*dot.Dot) (done <-chan struct{})
- func MakeDotChan() (out chan *dot.Dot)
- func PipeDotBuffer(inp <-chan *dot.Dot, cap int) (out <-chan *dot.Dot)
- func PipeDotFork(inp <-chan *dot.Dot) (out1, out2 <-chan *dot.Dot)
- func PipeDotFunc(inp <-chan *dot.Dot, act func(a *dot.Dot) *dot.Dot) (out <-chan *dot.Dot)
- func SendProxyDot(out chan<- *dot.Dot) chan<- *dot.Dot
- type DotTube
Constants ¶
const DotCAP = 10
DotCAP is the capacity of the buffered proxy channel
const DotQUE = 16
DotQUE is the allocated size of the circular queue
Variables ¶
This section is empty.
Functions ¶
func ChanDotFuncErr ¶
ChanDotFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanDotFuncNil ¶
ChanDotFuncNil returns a channel to receive all results of act until nil before close.
func ChanDotFuncNok ¶
ChanDotFuncNok returns a channel to receive all results of act until nok before close.
func ChanDotSlice ¶
ChanDotSlice returns a channel to receive all inputs before close.
func DoneDot ¶
DoneDot returns a channel to receive one signal before close after inp has been drained.
func DoneDotFunc ¶
DoneDotFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneDotSlice ¶
DoneDotSlice returns a channel which will receive a slice of all the Dots received on inp channel before close. Unlike DoneDot, a full slice is sent once, not just an event.
func DotDaisyChain ¶
DotDaisyChain returns a channel to receive all inp after having passed thru all tubes.
func JoinDot ¶
JoinDot sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinDotChan ¶
JoinDotChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinDotSlice ¶
JoinDotSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func MakeDotChan ¶
MakeDotChan returns a new open channel (simply a 'chan *dot.Dot' that is).
Note: No 'Dot-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myDotPipelineStartsHere := MakeDotChan() // ... lot's of code to design and build Your favourite "myDotWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myDotPipelineStartsHere <- drop } close(myDotPipelineStartsHere)
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 PipeDotBuffer) the channel is unbuffered.
func PipeDotBuffer ¶
PipeDotBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeDotFork ¶
PipeDotFork 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 PipeDotFunc ¶
PipeDotFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeDotMap for functional people, but 'map' has a very different meaning in go lang.
func SendProxyDot ¶
SendProxyDot 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"