Documentation ¶
Index ¶
- Constants
- func ChanTag(inp ...*tag.TagAny) (out <-chan *tag.TagAny)
- func ChanTagFuncErr(act func() (*tag.TagAny, error)) (out <-chan *tag.TagAny)
- func ChanTagFuncNil(act func() *tag.TagAny) (out <-chan *tag.TagAny)
- func ChanTagFuncNok(act func() (*tag.TagAny, bool)) (out <-chan *tag.TagAny)
- func ChanTagSlice(inp ...[]*tag.TagAny) (out <-chan *tag.TagAny)
- func DoneTag(inp <-chan *tag.TagAny) (done <-chan struct{})
- func DoneTagFunc(inp <-chan *tag.TagAny, act func(a *tag.TagAny)) (out <-chan struct{})
- func DoneTagSlice(inp <-chan *tag.TagAny) (done <-chan ([]*tag.TagAny))
- func JoinTag(out chan<- *tag.TagAny, inp ...*tag.TagAny) (done <-chan struct{})
- func JoinTagChan(out chan<- *tag.TagAny, inp <-chan *tag.TagAny) (done <-chan struct{})
- func JoinTagSlice(out chan<- *tag.TagAny, inp ...[]*tag.TagAny) (done <-chan struct{})
- func MakeTagChan() (out chan *tag.TagAny)
- func PipeTagBuffer(inp <-chan *tag.TagAny, cap int) (out <-chan *tag.TagAny)
- func PipeTagFork(inp <-chan *tag.TagAny) (out1, out2 <-chan *tag.TagAny)
- func PipeTagFunc(inp <-chan *tag.TagAny, act func(a *tag.TagAny) *tag.TagAny) (out <-chan *tag.TagAny)
- func SendProxyTag(out chan<- *tag.TagAny) chan<- *tag.TagAny
- func TagDaisy(inp <-chan *tag.TagAny, tube TagTube) (out <-chan *tag.TagAny)
- func TagDaisyChain(inp <-chan *tag.TagAny, tubes ...TagTube) (out <-chan *tag.TagAny)
- type TagTube
Constants ¶
const TagCAP = 10
TagCAP is the capacity of the buffered proxy channel
const TagQUE = 16
TagQUE is the allocated size of the circular queue
Variables ¶
This section is empty.
Functions ¶
func ChanTagFuncErr ¶
ChanTagFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanTagFuncNil ¶
ChanTagFuncNil returns a channel to receive all results of act until nil before close.
func ChanTagFuncNok ¶
ChanTagFuncNok returns a channel to receive all results of act until nok before close.
func ChanTagSlice ¶
ChanTagSlice returns a channel to receive all inputs before close.
func DoneTag ¶
DoneTag returns a channel to receive one signal before close after inp has been drained.
func DoneTagFunc ¶
DoneTagFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneTagSlice ¶
DoneTagSlice returns a channel which will receive a slice of all the Tags received on inp channel before close. Unlike DoneTag, a full slice is sent once, not just an event.
func JoinTag ¶
JoinTag sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinTagChan ¶
JoinTagChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinTagSlice ¶
JoinTagSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func MakeTagChan ¶
MakeTagChan returns a new open channel (simply a 'chan *tag.TagAny' that is).
Note: No 'Tag-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myTagPipelineStartsHere := MakeTagChan() // ... lot's of code to design and build Your favourite "myTagWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myTagPipelineStartsHere <- drop } close(myTagPipelineStartsHere)
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 PipeTagBuffer) the channel is unbuffered.
func PipeTagBuffer ¶
PipeTagBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeTagFork ¶
PipeTagFork 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 PipeTagFunc ¶
func PipeTagFunc(inp <-chan *tag.TagAny, act func(a *tag.TagAny) *tag.TagAny) (out <-chan *tag.TagAny)
PipeTagFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeTagMap for functional people, but 'map' has a very different meaning in go lang.
func SendProxyTag ¶
SendProxyTag 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"