Communication Sequence

Modesto will be running two threads. The first is the main thread (Left Side of Image), and its responsibility will be interpreting and executing commands. The second will be used for listening for requests, and writing responses to the sockets.

In order to communicate, they will need to have a shared queue, which will store incoming commands and outgoing responses. The queue will be a mutually exclusive object, and be usable by only one thread at a time.

Below is an image of the proposed communication sequence.

Main Thread Workflow

  1. Initialize Modesto
    1. Instantiate a new Modesto class
    2. Load all module libraries
    3. Call start-up events
    4. Connect to all servers
    5. Call connection events.
  2. Read Messages from Queue
    1. Check to see if there are any messages
    2. Convert all messages to RawCmd format.
    3. Pass the RamCmd to the command execute method.
  3. Execute all Commands
    1. Execute all events that the command is associated with.
    2. Place the responses into a temporary response container
  4. Queue all Messages
    1. Gain and lock control of the response queue.
    2. Add the responses to the queue
    3. Release the queue.
    4. Empty the temporary response container.
  5. Check for termination
    1. When all the connections are closed, then terminate.
    2. Otherwise, repeat back to step 2

Last edited Sep 2, 2013 at 7:30 AM by cbutcher, version 3


No comments yet.