January 2020
Intermediate to advanced
640 pages
16h 56m
English
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: ...