dotpath

package
v0.0.0-...-5012a73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DotPathCAP = 10

DotPathCAP is the capacity of the buffered proxy channel

View Source
const DotPathQUE = 16

DotPathQUE is the allocated size of the circular queue

Variables

This section is empty.

Functions

func ChanDotPath

func ChanDotPath(inp ...*dotpath.DotPath) (out <-chan *dotpath.DotPath)

ChanDotPath returns a channel to receive all inputs before close.

func ChanDotPathFuncErr

func ChanDotPathFuncErr(act func() (*dotpath.DotPath, error)) (out <-chan *dotpath.DotPath)

ChanDotPathFuncErr returns a channel to receive all results of act until err != nil before close.

func ChanDotPathFuncNil

func ChanDotPathFuncNil(act func() *dotpath.DotPath) (out <-chan *dotpath.DotPath)

ChanDotPathFuncNil returns a channel to receive all results of act until nil before close.

func ChanDotPathFuncNok

func ChanDotPathFuncNok(act func() (*dotpath.DotPath, bool)) (out <-chan *dotpath.DotPath)

ChanDotPathFuncNok returns a channel to receive all results of act until nok before close.

func ChanDotPathSlice

func ChanDotPathSlice(inp ...[]*dotpath.DotPath) (out <-chan *dotpath.DotPath)

ChanDotPathSlice returns a channel to receive all inputs before close.

func DoneDotPath

func DoneDotPath(inp <-chan *dotpath.DotPath) (done <-chan struct{})

DoneDotPath returns a channel to receive one signal before close after inp has been drained.

func DoneDotPathFunc

func DoneDotPathFunc(inp <-chan *dotpath.DotPath, act func(a *dotpath.DotPath)) (out <-chan struct{})

DoneDotPathFunc returns a channel to receive one signal before close after act has been applied to all inp.

func DoneDotPathSlice

func DoneDotPathSlice(inp <-chan *dotpath.DotPath) (done <-chan ([]*dotpath.DotPath))

DoneDotPathSlice returns a channel which will receive a slice of all the DotPaths received on inp channel before close. Unlike DoneDotPath, a full slice is sent once, not just an event.

func DotPathDaisy

func DotPathDaisy(inp <-chan *dotpath.DotPath, tube DotPathTube) (out <-chan *dotpath.DotPath)

DotPathDaisy returns a channel to receive all inp after having passed thru tube.

func DotPathDaisyChain

func DotPathDaisyChain(inp <-chan *dotpath.DotPath, tubes ...DotPathTube) (out <-chan *dotpath.DotPath)

DotPathDaisyChain returns a channel to receive all inp after having passed thru all tubes.

func JoinDotPath

func JoinDotPath(out chan<- *dotpath.DotPath, inp ...*dotpath.DotPath) (done <-chan struct{})

JoinDotPath sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinDotPathChan

func JoinDotPathChan(out chan<- *dotpath.DotPath, inp <-chan *dotpath.DotPath) (done <-chan struct{})

JoinDotPathChan sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func JoinDotPathSlice

func JoinDotPathSlice(out chan<- *dotpath.DotPath, inp ...[]*dotpath.DotPath) (done <-chan struct{})

JoinDotPathSlice sends inputs on the given out channel and returns a done channel to receive one signal when inp has been drained

func MakeDotPathChan

func MakeDotPathChan() (out chan *dotpath.DotPath)

MakeDotPathChan returns a new open channel (simply a 'chan *dotpath.DotPath' that is).

Note: No 'DotPath-producer' is launched here yet! (as is in all the other functions).

This is useful to easily create corresponding variables such as

var myDotPathPipelineStartsHere := MakeDotPathChan()
// ... lot's of code to design and build Your favourite "myDotPathWorkflowPipeline"
// ...
// ... *before* You start pouring data into it, e.g. simply via:
for drop := range water {
	myDotPathPipelineStartsHere <- drop
}
close(myDotPathPipelineStartsHere)

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 PipeDotPathBuffer) the channel is unbuffered.

func PipeDotPathBuffer

func PipeDotPathBuffer(inp <-chan *dotpath.DotPath, cap int) (out <-chan *dotpath.DotPath)

PipeDotPathBuffer returns a buffered channel with capacity cap to receive all inp before close.

func PipeDotPathFork

func PipeDotPathFork(inp <-chan *dotpath.DotPath) (out1, out2 <-chan *dotpath.DotPath)

PipeDotPathFork 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 PipeDotPathFunc

func PipeDotPathFunc(inp <-chan *dotpath.DotPath, act func(a *dotpath.DotPath) *dotpath.DotPath) (out <-chan *dotpath.DotPath)

PipeDotPathFunc returns a channel to receive every result of act applied to inp before close. Note: it 'could' be PipeDotPathMap for functional people, but 'map' has a very different meaning in go lang.

func SendProxyDotPath

func SendProxyDotPath(out chan<- *dotpath.DotPath) chan<- *dotpath.DotPath

SendProxyDotPath 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 DotPathTube

type DotPathTube func(inp <-chan *dotpath.DotPath, out <-chan *dotpath.DotPath)

DotPathTube is the signature for a pipe function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL