Documentation ¶
Overview ¶
Package simple provides a simple channeled orchestrator that can you can dial up or down parrallel operations and can multiplex to have large concurrent pipelines.
The designation of simple is an indication that this orchestrator has no decision branches, splitters to multiple different processors or syncronization points. This orchestrator shines when you need to hit each stage in order and the only branching is when there is an error.
However, don't let the "simple" designation fool you. This can do complex parallel operation pipelines concurrently at low memory and high speed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline is an orchestration pipeline for doing doing operations based on a request flow.
type Processor ¶
Processor processes data represented by "in". Returned data will either be used as input into the next Stage or if the last Stage, returned to the user. If err != nil, further processing of this request is stopped.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is the request object that enters the pipeline.
func NewRequest ¶
func NewRequest(ctx context.Context, cancel context.CancelFunc, data interface{}, options ...ReqOption) (Request, error)
NewRequest makes a new Request object. Data is the data you are sending to the Pipeline and counter is representing a series of requests that you must increment before sending.
type Response ¶
type Response struct { // Data is the data that was returned. Data interface{} // Err is the error, if there were any. Err error }
Repsone is the response from a pipeline.
type Stage ¶
type Stage struct {
// contains filtered or unexported fields
}
Stage represents a stage in the pipeline. A Stage takes input from an input channel, calls a Processor on the data, and either stops processing of the request because of an error or forwards that data onto an output channel that the Processor provided. A stage can be concurrent and have multiple Processors running.