January 2020
Intermediate to advanced
640 pages
16h 56m
English
As the name implies, when a stage operates in FIFO mode, it processes payloads sequentially, thereby maintaining their order. By creating a pipeline where all stages use FIFO dispatching, we can enforce synchronous-like semantics for data processing, but still retain the high throughput benefits associated with an asynchronous pipeline.
The fifo type is private within the pipeline package, but it can be instantiated via a call to the FIFO function, which is outlined as follows:
type fifo struct { proc Processor } // FIFO returns a StageRunner that processes incoming payloads in a // first-in first-out fashion. Each input is passed to the specified // processor and its output is emitted to the next stage. func FIFO(proc Processor) ...