Documentation
¶
Index ¶
- Constants
- func Chan(inp ...uintptr) chan uintptr
- func ChanFuncErr(act func() (uintptr, error)) <-chan uintptr
- func ChanFuncNok(act func() (uintptr, bool)) <-chan uintptr
- func ChanSlice(inp ...[]uintptr) chan uintptr
- func Daisy(inp <-chan uintptr, tube Tube) (out <-chan uintptr)
- func DaisyChain(inp <-chan uintptr, tubes ...Tube) (out <-chan uintptr)
- func Done(inp <-chan uintptr) chan struct{}
- func DoneFunc(inp <-chan uintptr, act func(a uintptr)) chan struct{}
- func DoneSlice(inp <-chan uintptr) chan []uintptr
- func Join(out chan<- uintptr, inp ...uintptr) chan struct{}
- func JoinChan(out chan<- uintptr, inp <-chan uintptr) chan struct{}
- func JoinSlice(out chan<- uintptr, inp ...[]uintptr) chan struct{}
- func MakeChan() chan uintptr
- func PipeBuffer(inp <-chan uintptr, cap int) chan uintptr
- func PipeFork(inp <-chan uintptr) (chan uintptr, chan uintptr)
- func PipeFunc(inp <-chan uintptr, act func(a uintptr) uintptr) chan uintptr
- func SendProxy(out chan<- uintptr) chan<- uintptr
- type Tube
Constants ¶
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 ChanFuncErr ¶
ChanFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanFuncNok ¶
ChanFuncNok returns a channel to receive all results of act until nok before close.
func DaisyChain ¶
DaisyChain returns a channel to receive all inp after having passed thru all tubes.
func Done ¶
func Done(inp <-chan uintptr) chan struct{}
Done returns a channel to receive one signal before close after inp has been drained.
func DoneFunc ¶
DoneFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneSlice ¶
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 ¶
Join sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinChan ¶
JoinChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinSlice ¶
JoinSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func MakeChan ¶
func MakeChan() chan uintptr
MakeChan returns a new open channel (simply a 'chan uintptr' 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 PipeBuffer ¶
PipeBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeFork ¶
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 ¶
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.