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

Establishing protocol buffer definitions for master payloads

Now, let's take a look at the protocol buffer definition for the payloads sent by the master to the individual workers:

message MasterPayload {  oneof payload {    JobDetails job_details = 1;    Step step = 2;    RelayMessage relay_message = 3;  }}

When a worker connects to the job queue, it blocks until the master assigns it a new job by sending out a JobDetails message:

message JobDetails {  string job_id = 1;  google.protobuf.Timestamp created_at = 2;    // The [from, to) UUID range assigned to the worker. Note that from is   // inclusive and to is exclusive.  bytes partition_from_uuid = 3;  bytes partition_to_uuid = 4;}

The job_id field contains a unique ID for the job to be executed while ...

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