Class ManualIoEventLoop

    • Method Detail

      • canBlock

        protected boolean canBlock()
        This allows to specify additional blocking conditions which will be used by the IoHandler to decide whether it is allowed to block or not.
      • ticker

        public final io.netty.util.concurrent.Ticker ticker()
        Specified by:
        ticker in interface io.netty.util.concurrent.EventExecutorGroup
        Overrides:
        ticker in class io.netty.util.concurrent.AbstractScheduledEventExecutor
      • runNonBlockingTasks

        public final int runNonBlockingTasks​(long timeoutNanos)
        Poll and run tasks from the task queue, until the task queue is empty or the given deadline is exceeded.
        If timeoutNanos is less or equals 0, no deadline is applied.
        Parameters:
        timeoutNanos - the maximum time in nanoseconds to run tasks.
      • runNow

        public final int runNow​(long runAllTasksTimeoutNanos)
        Executes all ready IO and tasks for this IoEventLoop. This methods will NOT block and wait for IO / tasks to be ready, it will just return directly if there is nothing to do.

        Must be called from the owning Thread that was passed as a parameter on construction.

        Parameters:
        runAllTasksTimeoutNanos - the maximum time in nanoseconds to run tasks. If = 0, no timeout is applied; if < 0 it just perform I/O tasks.
        Returns:
        the number of IO and tasks executed.
        Throws:
        IllegalStateException - if the method is not called from the owning Thread.
      • runNow

        public final int runNow()
        Run all ready IO and tasks for this IoEventLoop. This methods will NOT block and wait for IO / tasks to be ready, it will just return directly if there is nothing to do.

        Must be called from the owning Thread that was passed as a parameter on construction.

        Returns:
        the number of IO and tasks executed.
      • run

        public final int run​(long waitNanos,
                             long runAllTasksTimeoutNanos)
        Run all ready IO and tasks for this IoEventLoop. This methods will block and wait for IO / tasks to be ready if there is nothing to process atm for the given waitNanos.

        Must be called from the owning Thread that was passed as an parameter on construction.

        Parameters:
        runAllTasksTimeoutNanos - the maximum time in nanoseconds to run tasks. If = 0, no timeout is applied; if < 0 it just perform I/O tasks.
        waitNanos - the maximum amount of nanoseconds to wait before returning. IF 0 it will block until there is some IO / tasks ready, if -1 will not block at all and just return directly if there is nothing to run (like runNow()).
        Returns:
        the number of IO and tasks executed.
      • run

        public final int run​(long waitNanos)
        Run all ready IO and tasks for this IoEventLoop. This methods will block and wait for IO / tasks to be ready if there is nothing to process atm for the given waitNanos.

        Must be called from the owning Thread that was passed as an parameter on construction.

        Parameters:
        waitNanos - the maximum amount of nanoseconds to wait before returning. IF 0 it will block until there is some IO / tasks ready, if -1 will not block at all and just return directly if there is nothing to run (like runNow()).
        Returns:
        the number of IO and tasks executed.
      • wakeup

        public final void wakeup()
        Force a wakeup and so the run(long) method will unblock and return even if there was nothing to do.
      • parent

        public final IoEventLoopGroup parent()
        Specified by:
        parent in interface io.netty.util.concurrent.EventExecutor
        Specified by:
        parent in interface EventLoop
        Overrides:
        parent in class io.netty.util.concurrent.AbstractEventExecutor
      • inEventLoop

        public final boolean inEventLoop​(Thread thread)
        Specified by:
        inEventLoop in interface io.netty.util.concurrent.EventExecutor
      • setOwningThread

        public final void setOwningThread​(Thread owningThread)
        Set the owning thread that will call run(io.netty.channel.IoHandlerContext, long). May only be called once, and only if the owning thread was not set in the constructor already.
        Parameters:
        owningThread - The owning thread
      • shutdownGracefully

        public final io.netty.util.concurrent.Future<?> shutdownGracefully​(long quietPeriod,
                                                                           long timeout,
                                                                           TimeUnit unit)
        Specified by:
        shutdownGracefully in interface io.netty.util.concurrent.EventExecutorGroup
      • shutdown

        @Deprecated
        public final void shutdown()
        Deprecated.
        Specified by:
        shutdown in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        shutdown in interface ExecutorService
        Specified by:
        shutdown in class io.netty.util.concurrent.AbstractEventExecutor
      • terminationFuture

        public final io.netty.util.concurrent.Future<?> terminationFuture()
        Specified by:
        terminationFuture in interface io.netty.util.concurrent.EventExecutorGroup
      • isShuttingDown

        public final boolean isShuttingDown()
        Specified by:
        isShuttingDown in interface io.netty.util.concurrent.EventExecutorGroup