January 2019
Intermediate to advanced
520 pages
14h 32m
English
Since we have two methods, we will add a struct to perform remote calls of these methods from a worker thread. Add the Action enumeration to the code:
enum Action { StartRollCall, MarkItself,}
It has two variants: StartRollCall to perform the remote start_roll_call method call, and the MarkItself variant to call the remote mark_itself method.
Now we can add a function to spawn a worker in a separate thread. If we will perform outgoing calls immediately in incoming method handlers, we can block the execution, because we have a ring of microservices and blocking one microservice will block the whole ring's interaction.
Read now
Unlock full access