Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Implementing a stage worker for executing payload processors

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:

  1. Receive the next payload from the previous stage or the input source, if this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content