Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { // For simplicity here we are going to have each of these have exactly 3 values // and 5 slots, the 4th slot will calculate the total and the 5th slot the average. Data []int }
Data will implement T in our Request[T] above
type Pipeline ¶
type Pipeline[T any] struct { In chan Request[T] Out chan Request[T] // contains filtered or unexported fields }
Pipeline sets up a concurrent (kindof anyways) Pipeline.
func New ¶
func New[T any](sm StateMachine[T]) *Pipeline[T]
New creates a new Pipeline that utilzes the Stage(s) in "sm".
type Request ¶
type Request[T any] struct { // Ctx is the context for this request. Ctx context.Context // Err is used to store an error that occurred in the Pipeline. // If Err is set in any Stage, everything stops processing. Err error // Next is the next Stage to execute. If set to nil, processing stops. Next Stage[T] // Data is whatever data to use in the Pipeline. Data T }
Request is a Request to execute in the Pipeline.
type StateMachine ¶
StateMachine represents a statemachine where Start() is the entry Stage and you are directed to the next stage to run via Request[T].Next .
Click to show internal directories.
Click to hide internal directories.