To create a new worker, the user of the package invokes the NewWorker constructor, which returns a new Worker instance. The definition of the Worker type looks as follows:
The Worker type stores the following:
- The client gRPC connection to the master
- An instance of the JobQueueClient that the protoc compiler has automatically generated for us from the RPC definition for the job queue
- The required components for interfacing with the user's bspgraph-based algorithm implementation (that is, a job Runner and Serializer for graph messages and aggregator values)
After obtaining a new Worker instance, ...