Interface EventLoop


  • public interface EventLoop
    Discovered using ServiceLoader. At most one implementation may be present on the classpath.
    • Method Detail

      • isEventLoopThread

        boolean isEventLoopThread()
        Returns whether current thread is an event loop thread.

        When this method returns false, calling executor() doesn't make sense and throws UnsupportedOperationException.

      • executor

        Executor executor()
        Returns an Executor that 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.