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

The worker job coordinator

We will start by examining the coordinator logic that the worker side executes. Let's take a quick look at the constructor for the workerJobCoordinator type:

type workerJobCoordinatorConfig struct {    jobDetails job.Details    masterStream *remoteMasterStream    jobRunner job.Runner    serializer Serializer}func newWorkerJobCoordinator(ctx context.Context, cfg workerJobCoordinatorConfig) *workerJobCoordinator {    jobCtx, cancelJobCtx := context.WithCancel(ctx)    return &workerJobCoordinator{        jobCtx: jobCtx, cancelJobCtx: cancelJobCtx,        barrier: newWorkerStepBarrier(jobCtx, cfg.masterStream),        cfg: cfg,    }}

The constructor expects an external context as an argument as well as a configuration object, which includes the following: ...

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