Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option defines a functional configuration pattern for the Pipeline.
func WithAfter ¶
WithAfter adds a synchronous function to be executed only if all steps finished successfully and no external cancellation occurred.
func WithBefore ¶
WithBefore adds a synchronous function to be executed before any steps start. If it returns an error, the pipeline execution is aborted immediately.
type Pipeline ¶
type Pipeline[T any] struct { // contains filtered or unexported fields }
Pipeline is a generic, thread-safe execution engine that processes data through a series of named steps that are executed each in its own goroutine. It supports both single-shot execution and reactive listening. It guarantees that a previous run of a certain step had a chance to cleanup, if interrupted and not finished, before it is run again in a listening scenario.
func (*Pipeline[T]) AddStep ¶
AddStep registers a new task in the pipeline. Steps are executed sequentially. Each step is wrapped in its own goroutine but the pipeline waits for completion before moving to the next step.
func (*Pipeline[T]) Err ¶
Err returns a copy of the error map from the most recent pipeline execution. Returns nil if no errors occurred.