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

Using the master as an outgoing message relay

As we saw in the RunJob method's initialization block, once we gain access to an executor instance for the graph, we register a bspgraph.Replayer instance which serves as an escape hatch for relaying messages destined for vertices, which are managed by a different graph instance.

This is how the relayNonLocalMessage helper method is implemented:

func (c *workerJobCoordinator) relayNonLocalMessage(dst string, msg message.Message) error {
    serializedMsg, err := c.cfg.serializer.Serialize(msg)
    if err != nil {
        return xerrors.Errorf("unable to serialize message: %w", err) } wMsg := &proto.WorkerPayload{Payload: &proto.WorkerPayload_RelayMessage{ RelayMessage: &proto.RelayMessage{ Destination: dst, ...
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