public interface EventLoop extends Closeable
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG_ADDING_HANDLERS |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(EventHandler handler)
Adds a handler to the event loop to be executed.
|
void |
close()
Stops the event loop and then closes any resources being held.
|
static boolean |
inEventLoop()
Checks if the current thread is executing inside an event loop.
|
boolean |
isAlive()
Checks if the main thread of the event loop is running.
|
boolean |
isStopped()
Checks if the event loop is in the stopped state.
|
String |
name()
Retrieves the name of the event loop.
|
default boolean |
runsInsideCoreLoop()
Checks if the current thread is the core thread of this event loop, or if this information
cannot be determined.
|
void |
start()
Starts the event loop.
|
void |
stop()
Stops executing handlers and blocks until all handlers are complete.
|
void |
unpause()
Typically, implementations will unpause the event loop's pauser, if used.
|
closeQuietly, closeQuietlyisClosed, isClosingString name()
void addHandler(EventHandler handler)
start()
has been called.handler - The handler to be added to the event loop.void start()
void unpause()
void stop()
boolean isAlive()
true if the main thread is running, otherwise false.boolean isStopped()
true if the event loop is in the stopped state, otherwise false.static boolean inEventLoop()
true if the current thread is executing inside an event loop, otherwise false.void close()
close in interface AutoCloseableclose in interface CloseableAbstractCloseable.performClose()default boolean runsInsideCoreLoop()
false.true unless the current thread is not the core event thread.Copyright © 2024. All rights reserved.