Class SingleThreadIoEventLoop

    • Constructor Detail

      • SingleThreadIoEventLoop

        public SingleThreadIoEventLoop​(IoEventLoopGroup parent,
                                       ThreadFactory threadFactory,
                                       IoHandlerFactory ioHandlerFactory,
                                       int maxPendingTasks,
                                       io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler,
                                       long maxTaskProcessingQuantumMs)
        Creates a new instance
        Parameters:
        parent - the parent that holds this IoEventLoop.
        threadFactory - the ThreadFactory that is used to create the underlying Thread.
        ioHandlerFactory - the IoHandlerFactory that should be used to obtain IoHandler to handle IO.
        maxPendingTasks - the maximum pending tasks that are allowed before RejectedExecutionHandler.rejected(Runnable, SingleThreadEventExecutor) is called to handle it.
        rejectedExecutionHandler - the RejectedExecutionHandler that handles when more tasks are added then allowed per maxPendingTasks.
        maxTaskProcessingQuantumMs - the maximum number of milliseconds that will be spent to run tasks before trying to run IO again.
      • SingleThreadIoEventLoop

        public SingleThreadIoEventLoop​(IoEventLoopGroup parent,
                                       Executor executor,
                                       IoHandlerFactory ioHandlerFactory,
                                       int maxPendingTasks,
                                       io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler,
                                       long maxTaskProcessingQuantumMs)
        Creates a new instance
        Parameters:
        parent - the parent that holds this IoEventLoop.
        ioHandlerFactory - the IoHandlerFactory that should be used to obtain IoHandler to handle IO.
        maxPendingTasks - the maximum pending tasks that are allowed before RejectedExecutionHandler.rejected(Runnable, SingleThreadEventExecutor) is called to handle it.
        rejectedExecutionHandler - the RejectedExecutionHandler that handles when more tasks are added then allowed per maxPendingTasks.
        maxTaskProcessingQuantumMs - the maximum number of milliseconds that will be spent to run tasks before trying to run IO again.
      • SingleThreadIoEventLoop

        protected SingleThreadIoEventLoop​(IoEventLoopGroup parent,
                                          Executor executor,
                                          IoHandlerFactory ioHandlerFactory,
                                          Queue<Runnable> taskQueue,
                                          Queue<Runnable> tailTaskQueue,
                                          io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
        Creates a new instance
        Parameters:
        parent - the parent that holds this IoEventLoop.
        executor - the Executor that is used for dispatching the work.
        ioHandlerFactory - the IoHandlerFactory that should be used to obtain IoHandler to handle IO.
        taskQueue - the Queue used for storing pending tasks.
        tailTaskQueue - the Queue used for storing tail pending tasks.
        rejectedExecutionHandler - the RejectedExecutionHandler that handles when more tasks are added then allowed.
    • Method Detail

      • run

        protected void run()
        Specified by:
        run in class io.netty.util.concurrent.SingleThreadEventExecutor
      • ioHandler

        protected final IoHandler ioHandler()
      • canSuspend

        protected boolean canSuspend​(int state)
        Overrides:
        canSuspend in class io.netty.util.concurrent.SingleThreadEventExecutor
      • runIo

        protected int runIo()
        Called when IO will be processed for all the IoHandles on this SingleThreadIoEventLoop. This method returns the number of IoHandles for which IO was processed. This method must be called from the EventLoop thread.
      • wakeup

        protected final void wakeup​(boolean inEventLoop)
        Overrides:
        wakeup in class io.netty.util.concurrent.SingleThreadEventExecutor
      • cleanup

        protected final void cleanup()
        Overrides:
        cleanup in class io.netty.util.concurrent.SingleThreadEventExecutor
      • newTaskQueue

        protected Queue<Runnable> newTaskQueue​(int maxPendingTasks)
        Overrides:
        newTaskQueue in class io.netty.util.concurrent.SingleThreadEventExecutor
      • newTaskQueue0

        protected static Queue<Runnable> newTaskQueue0​(int maxPendingTasks)