January 2020
Intermediate to advanced
640 pages
16h 56m
English
remoteWorkerStream, the definition of which is shown in the following listing, is used by the master to wrap an incoming worker connection:
type remoteWorkerStream struct { stream proto.JobQueue_JobStreamServer recvMsgCh chan *proto.WorkerPayload sendMsgCh chan *proto.MasterPayload sendErrCh chan error mu sync.Mutex onDisconnectFn func() disconnected bool}As you can see in the preceding code, remoteWorkerStream defines three channels for interacting with the stream:
The code that interacts ...