January 2020
Intermediate to advanced
640 pages
16h 56m
English
To create a suitable executor factory for workers, we can use the following helper function:
func newWorkerExecutorFactory(serializer Serializer, barrier *workerStepBarrier) bspgraph.ExecutorFactory { f := &workerExecutorFactory{ serializer: serializer, barrier: barrier } return func(g *bspgraph.Graph, cb bspgraph.ExecutorCallbacks) *bspgraph.Executor { f.origCallbacks = cb patchedCb := bspgraph.ExecutorCallbacks{ PreStep: f.preStepCallback, PostStep: f.postStepCallback, PostStepKeepRunning: f.postStepKeepRunningCallback, } return bspgraph.NewExecutor(g, patchedCb) }}The newWorkerExecutorFactory function expects two arguments, namely a Serializer instance and an initialized workerStepBarrier object. The serializer ...