public class MDispatcher
extends java.lang.Object
MApp
instance and session.
Programs can dispatch events explicitly by calling nextEvent() for a
session or an MApp
instance. They can also allow the SDK event handler
to dispatch all events. This class allows for a third alternative:
applications can create a dispatcher for a specified MApp
and MSession
and stop the dispatcher as needed. This is particularly useful for
multithreading applications.
Constructor and Description |
---|
MDispatcher(MApp app)
Create an
MDispatcher instance for the specified MApp . |
MDispatcher(MApp app,
MSession session)
Create an
MDispatcher instance for the specified MApp . |
Modifier and Type | Method and Description |
---|---|
void |
stop()
Call this method to stop this dispatcher.
|
public MDispatcher(MApp app)
MDispatcher
instance for the specified MApp
.
This starts a thread dedicated to dispatching events from MApp
's default queue group.app
- MApp
for which you want to create a dispatcher.public MDispatcher(MApp app, MSession session)
MDispatcher
instance for the specified MApp
.
Upon creation, the dispatcher removes the queue for the specified
MSession
from the default SDK event queue and
starts a thread dedicated to dispatching events from this MSession's queue.app
- MApp
with which the MSession is associated.session
- MSession
instance for which you want to create a dispatcher.