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

Transitioning through the stages for the graph's state machine

The runJobToCompletion implementation for the master job coordinator is nearly identical to the one used by the worker:

func (c *masterJobCoordinator) runJobToCompletion(executor *bspgraph.Executor) error {
    if err := executor.RunToCompletion(c.jobCtx); err != nil {
        return err
    } else if _, err := c.barrier.WaitForWorkers(proto.Step_EXECUTED_GRAPH); err != nil {
        return err
    } else if err := c.barrier.NotifyWorkers(&proto.Step{Type: proto.Step_EXECUTED_GRAPH}); err != nil {
        return err
    } else if err := c.cfg.jobRunner.CompleteJob(c.cfg.jobDetails); err != nil {
        return err
    } else if _, err := c.barrier.WaitForWorkers(proto.Step_PESISTED_RESULTS); err != nil {
        return err
    } else if
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