public abstract class EventLoop<E> extends Object implements Logging
Note: The event queue will grow indefinitely. So subclasses should make sure onReceive
can
handle events in time to avoid the potential OOM.
Constructor and Description |
---|
EventLoop(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
isActive()
Return if the event thread has already been started but not yet stopped.
|
void |
post(E event)
Put the event into the event queue.
|
void |
start() |
void |
stop() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public void start()
public void stop()
public void post(E event)
public boolean isActive()