public class OnDemandEventLoop extends Object implements EventLoop
DEBUG_ADDING_HANDLERS
Constructor and Description |
---|
OnDemandEventLoop(@NotNull 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
EventLoop.stop() has been called) |
void |
close()
Stop the event loop, then close any resources being held.
|
boolean |
hasEventLoop() |
boolean |
isAlive() |
boolean |
isClosed()
Is this object closed
|
boolean |
isStopped() |
String |
name() |
void |
start()
Start the event loop
|
void |
stop()
Stop executing handlers and block until all handlers are complete.
|
void |
unpause()
Typical implementation will unpause the event loop's Pauser
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inEventLoop
closeQuietly, closeQuietly
isClosing
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
It is not expected that event loops can then be restarted.
public boolean isClosed()
QueryCloseable
isClosed
in interface QueryCloseable
public boolean isAlive()
public boolean isStopped()
public void awaitTermination()
EventLoop
EventLoop.stop()
has been called)awaitTermination
in interface EventLoop
public void close()
EventLoop
Blocks until the handlers are all stopped and closed
Copyright © 2023. All rights reserved.