|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.gleamynode.netty2.LowLatencyEventDispatcher
public class LowLatencyEventDispatcher
An EventDispatcher
that provides low latency. This event dispatcher
uses the same thread with IoProcessor
. So I/O operation will get
slow as SessionListener
processes 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 Summary | |
---|---|
LowLatencyEventDispatcher()
Creates a new low latency event dispatcher. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LowLatencyEventDispatcher()
Method Detail |
---|
public int getWaitingEventSize()
0
because this thread is not multi-threaded.
getWaitingEventSize
in interface EventDispatcher
getWaitingEventSize
in interface EventDispatcherMBean
EventDispatcher.getWaitingEventSize()
public void fire(Event event)
EventDispatcher
fire
in interface EventDispatcher
public void flush()
EventDispatcher
ReadController#processEvent(Event)
and
WriteController#processEvent(Event)
after the expected I/O
operations have been completed. So you can implement
EventDispatcher
to buffer the fireXXX
calls and
fire (flush) them here in actually.
flush
in interface EventDispatcher
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |