January 2020
Intermediate to advanced
640 pages
16h 56m
English
One of the goals of the pipeline package is to allow the end users to specify a per-stage strategy for dispatching incoming payloads to the registered processor functions. In order to be able to support different dispatch strategies in a clean and extensible way, we are going to be introducing yet another abstraction, the StageRunner interface:
type StageRunner interface { Run(context.Context, StageParams) }
Concrete StageRunner implementations provide a Run method that implements the payload processing loop for a single stage of the pipeline. A typical processing loop consists of the following steps: