public class LowLatencyEventDispatcher extends java.lang.Object implements EventDispatcher, LowLatencyEventDispatcherMBean
EventDispatcherthat provides low latency. This event dispatcher
uses the same thread with IoProcessor. So I/O operation will get
slow as SessionListenerprocesses events slowly, and you'll have to
adjust I/O thread pool size using IoProcessor.setThreadPoolSize(int).
There is no need to invoke any initialization/deinitialization methods.
Please note that I/O threads will not terminate even if
IoProcessor.stop()is invoked if there are any remaining events for
process to this event dispatcher. They will be terminated when JVM exits
because they are daemon threads.
| Constructor and Description |
|---|
LowLatencyEventDispatcher()
Creates a new low latency event dispatcher.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fire(Event event)
Fires the specified session event.
|
void |
flush()
(Optional operation) Flushes the buffered events.
|
int |
getWaitingEventSize()
Returns
0 because this thread is not multi-threaded. |
public LowLatencyEventDispatcher()
public int getWaitingEventSize()
0 because this thread is not multi-threaded.getWaitingEventSize in interface EventDispatchergetWaitingEventSize in interface EventDispatcherMBeanEventDispatcher.getWaitingEventSize()public void fire(Event event)
EventDispatcherfire in interface EventDispatcherpublic void flush()
EventDispatcherReadController.processEvent(Event)and
WriteController.processEvent(Event)after the expected I/O
operations have been completed. So you can implement
EventDispatcherto buffer the fireXXX calls and
fire (flush) them here in actually.flush in interface EventDispatcherCopyright © 2004-2012 Trustin Lee. All Rights Reserved.