Interface EventLoop
-
public interface EventLoopDiscovered usingServiceLoader. At most one implementation may be present on the classpath.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Executorexecutor()Returns anExecutorthat runs tasks on the current thread's event loop.static EventLoopget()booleanisEventLoopThread()Returns whether current thread is an event loop thread.
-
-
-
Method Detail
-
isEventLoopThread
boolean isEventLoopThread()
Returns whether current thread is an event loop thread.When this method returns
false, callingexecutor()doesn't make sense and throwsUnsupportedOperationException.
-
executor
Executor executor()
Returns anExecutorthat runs tasks on the current thread's event loop.Pay attention to when you call this method. If you want to later use an executor for current thread's event loop, possibly even from a different thread, call this method early and remember the result.
-
get
static EventLoop get()
-
-