Documentation
¶
Index ¶
- func Connect(s Sender, r Receiver) error
- type ContextFn
- type Pipeline
- func (p *Pipeline) Abort(err error)
- func (p *Pipeline) Chain(fn ContextFn) error
- func (p *Pipeline) ConnectNtoM(n, m int, fn ContextFn) error
- func (p *Pipeline) FanIn(n int, fn ContextFn) error
- func (p *Pipeline) FanOut(fn ContextFn, n int) error
- func (p *Pipeline) Start(v interface{})
- func (p *Pipeline) Wait() error
- func (p *Pipeline) WaitWithTimeout(dur time.Duration) error
- type Process
- type Processor
- type Receiver
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextFn ¶
ContextFn wraps the users function and provides the necessary controls to alert the pipeline of completion and errors
type Pipeline ¶
type Pipeline struct { Procs []Processor // contains filtered or unexported fields }
Pipeline contains a group of chained processes and waits for completion or an error to occur
* * Error Handling: * There is an error channel wrapped in a func called Abort that all processes can access. * Calling the Abort fn causes the Pipeline to Close all running processes, decrement the wg counter * and then return the error * * Concurrency Patterns Implemented: * Fan In: Using the fan in method allows the user to connect one receiver channel to N sender channels * Fan Out: Using the fan out method allows the user to connect one send channel to N receiver channels * Append: Simply connects one sender to one receiver. * Connect N to M: Create method to bridge N senders to N receivers *
func (*Pipeline) ConnectNtoM ¶
ConnectNtoM ...
func (*Pipeline) Start ¶
func (p *Pipeline) Start(v interface{})
Start sends data to the first process in the pipeline
type Process ¶
type Process struct { Run ContextFn // contains filtered or unexported fields }
Process waits for work, processes the work via the ContextFn and finally sends the work to a subsequent process
Click to show internal directories.
Click to hide internal directories.