T
- the message typepublic class MessageDispatcher<T> extends CancellableLoop
Constructor and Description |
---|
MessageDispatcher(CircularBlockingDeque<LazyMessage<T>> lazyMessages,
java.util.concurrent.ExecutorService executorService) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(org.ros.message.MessageListener<T> messageListener,
int limit)
Adds the specified
MessageListener to the internal
ListenerGroup . |
boolean |
getLatchMode() |
protected void |
handleInterruptedException(java.lang.InterruptedException e)
An
InterruptedException was thrown. |
void |
loop()
The body of the loop.
|
void |
setLatchMode(boolean enabled) |
cancel, isRunning, run, setup
public MessageDispatcher(CircularBlockingDeque<LazyMessage<T>> lazyMessages, java.util.concurrent.ExecutorService executorService)
public void addListener(org.ros.message.MessageListener<T> messageListener, int limit)
MessageListener
to the internal
ListenerGroup
. If latchMode
is true
, the
latchedMessage
will be immediately dispatched to the specified
MessageListener
.ListenerGroup.add(Object, int)
public void setLatchMode(boolean enabled)
enabled
- true
if latch mode should be enabled, false
otherwisepublic boolean getLatchMode()
true
if latch mode is enabled, false
otherwisepublic void loop() throws java.lang.InterruptedException
CancellableLoop
CancellableLoop
has been interrupted externally or by calling
CancellableLoop.cancel()
.loop
in class CancellableLoop
java.lang.InterruptedException
protected void handleInterruptedException(java.lang.InterruptedException e)
CancellableLoop
InterruptedException
was thrown.handleInterruptedException
in class CancellableLoop