The MessageDispatcher object is a singleton object that is responsible for shuttling messages across services. It can do that, because all services in the system register themselves to the dispatcher who in turn invokes the service's member function when a message arrives for that service.

The MessageDispatcher runs in its own thread. When the message dispatcher invokes a function in a service a service can do one of 3 things.

  1. Handle the function in the Dispatcher thread context
  2. Push the message to its own worker thread
  3. Push the message to the system worker thread

Note that handling the function in the Dispatcher thread context should only be done if the message handler work is minimal. Functions that take longer to execute should not run in the dispatcher context because they will prevent other messages from being processed in the entire system.


Generated on Wed Oct 12 2011 21:46:52. © CodeLathe LLC 2007-2011. All Rights Reserved.