Documentation ¶
Index ¶
- Constants
- func ChanLSM(inp ...*lsm.LazyStringerMap) chan *lsm.LazyStringerMap
- func ChanLSMFuncErr(act func() (*lsm.LazyStringerMap, error)) <-chan *lsm.LazyStringerMap
- func ChanLSMFuncNil(act func() *lsm.LazyStringerMap) <-chan *lsm.LazyStringerMap
- func ChanLSMFuncNok(act func() (*lsm.LazyStringerMap, bool)) <-chan *lsm.LazyStringerMap
- func ChanLSMSlice(inp ...[]*lsm.LazyStringerMap) chan *lsm.LazyStringerMap
- func DoneLSM(inp <-chan *lsm.LazyStringerMap) chan struct{}
- func DoneLSMFunc(inp <-chan *lsm.LazyStringerMap, act func(a *lsm.LazyStringerMap)) chan struct{}
- func DoneLSMSlice(inp <-chan *lsm.LazyStringerMap) chan []*lsm.LazyStringerMap
- func JoinLSM(out chan<- *lsm.LazyStringerMap, inp ...*lsm.LazyStringerMap) chan struct{}
- func JoinLSMChan(out chan<- *lsm.LazyStringerMap, inp <-chan *lsm.LazyStringerMap) chan struct{}
- func JoinLSMSlice(out chan<- *lsm.LazyStringerMap, inp ...[]*lsm.LazyStringerMap) chan struct{}
- func LSMDaisy(inp <-chan *lsm.LazyStringerMap, tube LSMTube) (out <-chan *lsm.LazyStringerMap)
- func LSMDaisyChain(inp <-chan *lsm.LazyStringerMap, tubes ...LSMTube) (out <-chan *lsm.LazyStringerMap)
- func MakeLSMChan() chan *lsm.LazyStringerMap
- func PipeLSMBuffer(inp <-chan *lsm.LazyStringerMap, cap int) chan *lsm.LazyStringerMap
- func PipeLSMFork(inp <-chan *lsm.LazyStringerMap) (chan *lsm.LazyStringerMap, chan *lsm.LazyStringerMap)
- func PipeLSMFunc(inp <-chan *lsm.LazyStringerMap, ...) chan *lsm.LazyStringerMap
- func SendProxyLSM(out chan<- *lsm.LazyStringerMap) chan<- *lsm.LazyStringerMap
- type LSMTube
Constants ¶
const LSMCAP = 10
LSMCAP is the capacity of the buffered proxy channel
const LSMQUE = 16
LSMQUE is the allocated size of the circular queue
Variables ¶
This section is empty.
Functions ¶
func ChanLSM ¶
func ChanLSM(inp ...*lsm.LazyStringerMap) chan *lsm.LazyStringerMap
ChanLSM returns a channel to receive all inputs before close.
func ChanLSMFuncErr ¶
func ChanLSMFuncErr(act func() (*lsm.LazyStringerMap, error)) <-chan *lsm.LazyStringerMap
ChanLSMFuncErr returns a channel to receive all results of act until err != nil before close.
func ChanLSMFuncNil ¶
func ChanLSMFuncNil(act func() *lsm.LazyStringerMap) <-chan *lsm.LazyStringerMap
ChanLSMFuncNil returns a channel to receive all results of act until nil before close.
func ChanLSMFuncNok ¶
func ChanLSMFuncNok(act func() (*lsm.LazyStringerMap, bool)) <-chan *lsm.LazyStringerMap
ChanLSMFuncNok returns a channel to receive all results of act until nok before close.
func ChanLSMSlice ¶
func ChanLSMSlice(inp ...[]*lsm.LazyStringerMap) chan *lsm.LazyStringerMap
ChanLSMSlice returns a channel to receive all inputs before close.
func DoneLSM ¶
func DoneLSM(inp <-chan *lsm.LazyStringerMap) chan struct{}
DoneLSM returns a channel to receive one signal before close after inp has been drained.
func DoneLSMFunc ¶
func DoneLSMFunc(inp <-chan *lsm.LazyStringerMap, act func(a *lsm.LazyStringerMap)) chan struct{}
DoneLSMFunc returns a channel to receive one signal before close after act has been applied to all inp.
func DoneLSMSlice ¶
func DoneLSMSlice(inp <-chan *lsm.LazyStringerMap) chan []*lsm.LazyStringerMap
DoneLSMSlice returns a channel which will receive a slice of all the LSMs received on inp channel before close. Unlike DoneLSM, a full slice is sent once, not just an event.
func JoinLSM ¶
func JoinLSM(out chan<- *lsm.LazyStringerMap, inp ...*lsm.LazyStringerMap) chan struct{}
JoinLSM sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinLSMChan ¶
func JoinLSMChan(out chan<- *lsm.LazyStringerMap, inp <-chan *lsm.LazyStringerMap) chan struct{}
JoinLSMChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func JoinLSMSlice ¶
func JoinLSMSlice(out chan<- *lsm.LazyStringerMap, inp ...[]*lsm.LazyStringerMap) chan struct{}
JoinLSMSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained
func LSMDaisy ¶
func LSMDaisy(inp <-chan *lsm.LazyStringerMap, tube LSMTube) (out <-chan *lsm.LazyStringerMap)
LSMDaisy returns a channel to receive all inp after having passed thru tube.
func LSMDaisyChain ¶
func LSMDaisyChain(inp <-chan *lsm.LazyStringerMap, tubes ...LSMTube) (out <-chan *lsm.LazyStringerMap)
LSMDaisyChain returns a channel to receive all inp after having passed thru all tubes.
func MakeLSMChan ¶
func MakeLSMChan() chan *lsm.LazyStringerMap
MakeLSMChan returns a new open channel (simply a 'chan *lsm.LazyStringerMap' that is).
Note: No 'LSM-producer' is launched here yet! (as is in all the other functions).
This is useful to easily create corresponding variables such as
var myLSMPipelineStartsHere := MakeLSMChan() // ... lot's of code to design and build Your favourite "myLSMWorkflowPipeline" // ... // ... *before* You start pouring data into it, e.g. simply via: for drop := range water { myLSMPipelineStartsHere <- drop } close(myLSMPipelineStartsHere)
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 PipeLSMBuffer) the channel is unbuffered.
func PipeLSMBuffer ¶
func PipeLSMBuffer(inp <-chan *lsm.LazyStringerMap, cap int) chan *lsm.LazyStringerMap
PipeLSMBuffer returns a buffered channel with capacity cap to receive all inp before close.
func PipeLSMFork ¶
func PipeLSMFork(inp <-chan *lsm.LazyStringerMap) (chan *lsm.LazyStringerMap, chan *lsm.LazyStringerMap)
PipeLSMFork 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 PipeLSMFunc ¶
func PipeLSMFunc(inp <-chan *lsm.LazyStringerMap, act func(a *lsm.LazyStringerMap) *lsm.LazyStringerMap) chan *lsm.LazyStringerMap
PipeLSMFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeLSMMap for functional people, but 'map' has a very different meaning in go lang.
func SendProxyLSM ¶
func SendProxyLSM(out chan<- *lsm.LazyStringerMap) chan<- *lsm.LazyStringerMap
SendProxyLSM 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"
Types ¶
type LSMTube ¶
type LSMTube func(inp <-chan *lsm.LazyStringerMap, out <-chan *lsm.LazyStringerMap)
LSMTube is the signature for a pipe function.