This PR refactored to use an explicit TMB client (called agent) to send messages on behalf of InsertDestinations and some WorkOrders to Foreman.
The previous implementation uses a globally accessible map to implicitly use Worker's client id as sender, but it is hard to understand / debug.
In the distributed version, Shiftboss would act as the agent so that Foreman could have data locality information based on the message sender's client id for better scheduling on later WorkOrders.
This PR refactored to use an explicit TMB client (called
agent
) to send messages on behalf ofInsertDestination
s and someWorkOrder
s to Foreman.The previous implementation uses a
globally accessible map
to implicitly useWorker
's client id as sender, but it is hard to understand / debug.In the distributed version,
Shiftboss
would act as theagent
so that Foreman could have data locality information based on the message sender's client id for better scheduling on laterWorkOrder
s.