You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
laforge49 edited this page Nov 9, 2011
·
4 revisions
Objects which receive messages must implement the MessageProcessor trait.
Note that the API does not pass messages directly to a MessageProcessor object, but instead a MessageProcessor object is informed when there is a message to be processed and called to process a message. Doing things this way facilitates the implementation of the code used to achieve high-performance.
/**
* A MessageProcessor object processes messages and
* receives notifications that there are messages to be processed.
*/
trait MessageProcessor[T] {
/**
* The processMessage method is called when
* there may be an incoming message to process.
*/
def processMessage(message: T)
/**
* The haveMessage method is called when
* there may be an incoming message to be processed.
*/
def haveMessage
}