#include <EventLooper.h>
Node.
EventLooper spawns a new thread of execution to listen for muscle::Message arriving on a slayer::PacketPort. Arriving messages are filtered for messages intended for the EventLooper or its Node and dispatches the messages accordingly.
EventLoopers are created by the framework on behalf of client code or when registering a node that doesn't have an associated looper.
Currently each EventLooper is associated with one Node. In the future this may be changed to allow one EventLooper to handle messaging for more than one Node reduce the number of threads needed for some Node network configurations.
Public Member Functions | |
| status_t | AddNode (Node *node) |
Tell an EventLooper to begin handling messaging for a given Node. | |
| status_t | RemoveNode (Node *node) |
Remove a Node from an EventLooper. | |
| status_t | AcquireLock () |
Acquire the EventLooper synchronization lock. | |
| status_t | ReleaseLock () |
Release the EventLooper synchronization lock. | |
Protected Member Functions | |
| EventLooper () | |
Create a new EventLooper. | |
| virtual | ~EventLooper () |
Delete and EventLooper. | |
| virtual void | MessageReceived (muscle::Message *message) |
This is called from the message handling thread with the EventLooper lock held to handle an incoming message. | |
| status_t | StartMessageThread () |
| Start the message handling thread. | |
| status_t | StopMessaageThread () |
| Stop the message handling thread. | |
|
|
Create a new
The message handling thread will need to be started before the new |
|
|
Delete and The message handling thread will be stopped if it is running. |
|
|
Acquire the
|
|
|
Tell an
|
|
|
This is called from the message handling thread with the
Implementations of this should be sure to call through to
|
|
|
Release the
|
|
|
Remove a
The
|
|
|
Start the message handling thread.
|
|
|
Stop the message handling thread.
|
1.3.9.1