public class OnDemandEventLoop extends Object implements EventLoop
DEBUG_ADDING_HANDLERS
Constructor and Description |
---|
OnDemandEventLoop(Supplier<EventLoop> eventLoopSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(EventHandler handler)
Add handler to event loop to be executed.
|
void |
awaitTermination()
Wait until the event loop has terminated (after close has been called)
|
void |
close()
Doesn't throw a checked exception.
|
boolean |
hasEventLoop() |
boolean |
isAlive() |
boolean |
isClosed() |
String |
name() |
void |
start()
Start the event loop
|
void |
stop()
Notify event loop to stop executing handlers.
|
void |
unpause()
Typical implementation will unpause the event loop's Pauser
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeQuietly, closeQuietly, notifyClosing
isClosing, throwExceptionIfClosed
public boolean hasEventLoop()
public void addHandler(EventHandler handler)
EventLoop
EventLoop.start()
has been called.addHandler
in interface EventLoop
handler
- handlerpublic void start()
EventLoop
public void unpause()
EventLoop
public void stop()
EventLoop
public boolean isClosed()
isClosed
in interface QueryCloseable
isClosed
in interface EventLoop
true
close has been calledpublic boolean isAlive()
public void awaitTermination()
EventLoop
awaitTermination
in interface EventLoop
public void close()
Closeable
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2021. All rights reserved.