GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.channel
  • ThreadPerChannelEventLoop

This view

  • Original page
  • New address

GeezerVison is showing netty.io — ThreadPerChannelEventLoop (Netty API Reference (4.1.141.Final))

Class ThreadPerChannelEventLoop

java.lang.Object
java.util.concurrent.AbstractExecutorService
io.netty.util.concurrent.AbstractEventExecutor
io.netty.util.concurrent.AbstractScheduledEventExecutor
io.netty.util.concurrent.SingleThreadEventExecutor
io.netty.channel.SingleThreadEventLoop
io.netty.channel.ThreadPerChannelEventLoop
All Implemented Interfaces:
EventLoop, EventLoopGroup, EventExecutor, EventExecutorGroup, OrderedEventExecutor, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService

@Deprecated public class ThreadPerChannelEventLoop extends SingleThreadEventLoop
Deprecated.
this will be remove in the next-major release.
SingleThreadEventLoop which is used to handle OIO Channel's. So in general there will be one ThreadPerChannelEventLoop per Channel.
  • Nested Class Summary

    Nested classes/interfaces inherited from class SingleThreadEventLoop

    SingleThreadEventLoop.ChannelsReadOnlyIterator<T>
    Modifier and Type
    Class
    Description
    protected static final class 
    SingleThreadEventLoop.ChannelsReadOnlyIterator<T extends Channel>
     

    Nested classes/interfaces inherited from class SingleThreadEventExecutor

    SingleThreadEventExecutor.NonWakeupRunnable
    Modifier and Type
    Class
    Description
    protected static interface 
    SingleThreadEventExecutor.NonWakeupRunnable
    Deprecated.
    override SingleThreadEventExecutor.wakesUpForTask(Runnable) to re-create this behaviour

    Nested classes/interfaces inherited from class AbstractEventExecutor

    AbstractEventExecutor.LazyRunnable
    Modifier and Type
    Class
    Description
    static interface 
    AbstractEventExecutor.LazyRunnable
    Deprecated.
    override SingleThreadEventExecutor.wakesUpForTask(Runnable) to re-create this behaviour
  • Field Summary

    Fields inherited from class SingleThreadEventLoop

    DEFAULT_MAX_PENDING_TASKS
    Modifier and Type
    Field
    Description
    protected static final int
    DEFAULT_MAX_PENDING_TASKS
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThreadPerChannelEventLoop(ThreadPerChannelEventLoopGroup parent)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    deregister()
    Deprecated.
     
    ChannelFuture
    register(ChannelPromise promise)
    Deprecated.
    Register a Channel with this EventLoop using a ChannelFuture.
    ChannelFuture
    register(Channel channel, ChannelPromise promise)
    Deprecated.
    int
    registeredChannels()
    Deprecated.
    Returns the number of Channels registered with this EventLoop or -1 if operation is not supported.
    protected void
    run()
    Deprecated.
    Runs the task-processing loop until SingleThreadEventExecutor.confirmShutdown() returns true.

    Methods inherited from class SingleThreadEventLoop

    afterRunningAllTasks, executeAfterEventLoopIteration, hasTasks, next, parent, pendingTasks, register, registeredChannelsIterator
    Modifier and Type
    Method
    Description
    protected void
    afterRunningAllTasks()
    Invoked before returning from SingleThreadEventExecutor.runAllTasks() and SingleThreadEventExecutor.runAllTasks(long).
    final void
    executeAfterEventLoopIteration(Runnable task)
    Adds a task to be run once at the end of next (or current) eventloop iteration.
    protected boolean
    hasTasks()
     
    EventLoop
    next()
    Returns a reference to itself.
    EventLoopGroup
    parent()
    Return the EventExecutorGroup which is the parent of this EventExecutor,
    int
    pendingTasks()
    Return the number of tasks that are pending for processing.
    ChannelFuture
    register(Channel channel)
    Register a Channel with this EventLoop.
    Iterator<Channel>
    registeredChannelsIterator()
     

    Methods inherited from class SingleThreadEventExecutor

    addShutdownHook, addTask, awaitTermination, cleanup, confirmShutdown, deadlineNanos, delayNanos, execute, inEventLoop, interruptThread, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isTerminated, lazyExecute, newTaskQueue, newTaskQueue, peekTask, pollTask, pollTaskFrom, reject, reject, removeShutdownHook, removeTask, runAllTasks, runAllTasks, runAllTasksFrom, runScheduledAndExecutorTasks, shutdown, shutdownGracefully, takeTask, terminationFuture, threadProperties, updateLastExecutionTime, wakesUpForTask, wakeup
    Modifier and Type
    Method
    Description
    void
    addShutdownHook(Runnable task)
    Add a Runnable which will be executed on shutdown of this instance
    protected void
    addTask(Runnable task)
    Add a task to the task queue, or throws a RejectedExecutionException if this instance was shutdown before.
    boolean
    awaitTermination(long timeout, TimeUnit unit)
     
    protected void
    cleanup()
    Do nothing, sub-classes may override
    protected boolean
    confirmShutdown()
    Confirm that the shutdown if the instance should be done now!
    protected long
    deadlineNanos()
    Returns the absolute point in time (relative to AbstractScheduledEventExecutor.getCurrentTimeNanos()) at which the next closest scheduled task should run.
    protected long
    delayNanos(long currentTimeNanos)
    Returns the amount of time left until the scheduled task with the closest dead line is executed.
    void
    execute(Runnable task)
     
    boolean
    inEventLoop(Thread thread)
    Return true if the given Thread is executed in the event loop, false otherwise.
    protected void
    interruptThread()
    Interrupt the current running Thread.
    <T> List<Future<T>>
    invokeAll(Collection<? extends Callable<T>> tasks)
     
    <T> List<Future<T>>
    invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
     
    <T> T
    invokeAny(Collection<? extends Callable<T>> tasks)
     
    <T> T
    invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
     
    boolean
    isShutdown()
     
    boolean
    isShuttingDown()
    Returns true if and only if all EventExecutors managed by this EventExecutorGroup are being shut down gracefully or was shut down.
    boolean
    isTerminated()
     
    void
    lazyExecute(Runnable task)
    Like Executor.execute(Runnable) but does not guarantee the task will be run until either a non-lazy task is executed or the executor is shut down.
    protected Queue<Runnable>
    newTaskQueue()
    Deprecated.
    Please use and override SingleThreadEventExecutor.newTaskQueue(int).
    protected Queue<Runnable>
    newTaskQueue(int maxPendingTasks)
    Create a new Queue which will holds the tasks to execute.
    protected Runnable
    peekTask()
     
    protected Runnable
    pollTask()
     
    protected static Runnable
    pollTaskFrom(Queue<Runnable> taskQueue)
     
    protected static void
    reject()
     
    protected final void
    reject(Runnable task)
    Offers the task to the associated RejectedExecutionHandler.
    void
    removeShutdownHook(Runnable task)
    Remove a previous added Runnable as a shutdown hook
    protected boolean
    removeTask(Runnable task)
     
    protected boolean
    runAllTasks()
    Poll all tasks from the task queue and run them via Runnable.run() method.
    protected boolean
    runAllTasks(long timeoutNanos)
    Poll all tasks from the task queue and run them via Runnable.run() method.
    protected final boolean
    runAllTasksFrom(Queue<Runnable> taskQueue)
    Runs all tasks from the passed taskQueue.
    protected final boolean
    runScheduledAndExecutorTasks(int maxDrainAttempts)
    Execute all expired scheduled tasks and all current tasks in the executor queue until both queues are empty, or maxDrainAttempts has been exceeded.
    void
    shutdown()
    Deprecated.
    Future<?>
    shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)
    Signals this executor that the caller wants the executor to be shut down.
    protected Runnable
    takeTask()
    Take the next Runnable from the task queue and so will block if no task is currently present.
    Future<?>
    terminationFuture()
    Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.
    final ThreadProperties
    threadProperties()
    Returns the ThreadProperties of the Thread that powers the SingleThreadEventExecutor.
    protected void
    updateLastExecutionTime()
    Updates the internal timestamp that tells when a submitted task was executed most recently.
    protected boolean
    wakesUpForTask(Runnable task)
    Can be overridden to control which tasks require waking the EventExecutor thread if it is waiting so that they can be run immediately.
    protected void
    wakeup(boolean inEventLoop)
     

    Methods inherited from class AbstractScheduledEventExecutor

    afterScheduledTaskSubmitted, beforeScheduledTaskSubmitted, cancelScheduledTasks, deadlineToDelayNanos, getCurrentTimeNanos, hasScheduledTasks, initialNanoTime, nanoTime, nextScheduledTaskDeadlineNanos, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, validateScheduled
    Modifier and Type
    Method
    Description
    protected boolean
    afterScheduledTaskSubmitted(long deadlineNanos)
    See AbstractScheduledEventExecutor.beforeScheduledTaskSubmitted(long).
    protected boolean
    beforeScheduledTaskSubmitted(long deadlineNanos)
    Called from arbitrary non-EventExecutor threads prior to scheduled task submission.
    protected void
    cancelScheduledTasks()
    Cancel all scheduled tasks.
    protected static long
    deadlineToDelayNanos(long deadlineNanos)
    Given an arbitrary deadline deadlineNanos, calculate the number of nano seconds from now deadlineNanos would expire.
    protected long
    getCurrentTimeNanos()
    Get the current time in nanoseconds by this executor's clock.
    protected final boolean
    hasScheduledTasks()
    Returns true if a scheduled task is ready for processing.
    protected static long
    initialNanoTime()
    The initial value used for delay and computations based upon a monatomic time source.
    protected static long
    nanoTime()
    Deprecated.
    Use the non-static AbstractScheduledEventExecutor.getCurrentTimeNanos() instead.
    protected final long
    nextScheduledTaskDeadlineNanos()
    Return the deadline (in nanoseconds) when the next scheduled task is ready to be run or -1 if no task is scheduled.
    protected final long
    nextScheduledTaskNano()
    Return the nanoseconds until the next scheduled task is ready to be run or -1 if no task is scheduled.
    protected final Runnable
    pollScheduledTask()
     
    protected final Runnable
    pollScheduledTask(long nanoTime)
    Return the Runnable which is ready to be executed with the given nanoTime.
    ScheduledFuture<?>
    schedule(Runnable command, long delay, TimeUnit unit)
     
    <V> ScheduledFuture<V>
    schedule(Callable<V> callable, long delay, TimeUnit unit)
     
    ScheduledFuture<?>
    scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
     
    ScheduledFuture<?>
    scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
     
    protected void
    validateScheduled(long amount, TimeUnit unit)
    Deprecated.
    will be removed in the future.

    Methods inherited from class AbstractEventExecutor

    inEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, runTask, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submit
    Modifier and Type
    Method
    Description
    boolean
    inEventLoop()
    Calls EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument
    Iterator<EventExecutor>
    iterator()
     
    <V> Future<V>
    newFailedFuture(Throwable cause)
    Create a new Future which is marked as failed already.
    <V> ProgressivePromise<V>
    newProgressivePromise()
    Create a new ProgressivePromise.
    <V> Promise<V>
    newPromise()
    Return a new Promise.
    <V> Future<V>
    newSucceededFuture(V result)
    Create a new Future which is marked as succeeded already.
    protected final <T> RunnableFuture<T>
    newTaskFor(Runnable runnable, T value)
     
    protected final <T> RunnableFuture<T>
    newTaskFor(Callable<T> callable)
     
    protected static void
    runTask(Runnable task)
     
    protected static void
    safeExecute(Runnable task)
    Try to execute the given Runnable and just log if it throws a Throwable.
    Future<?>
    shutdownGracefully()
    Shortcut method for EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.
    List<Runnable>
    shutdownNow()
    Deprecated.
    EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) or AbstractEventExecutor.shutdownGracefully() instead.
    Future<?>
    submit(Runnable task)
     
    <T> Future<T>
    submit(Runnable task, T result)
     
    <T> Future<T>
    submit(Callable<T> task)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface Iterable

    forEach, spliterator
  • Constructor Details

    • ThreadPerChannelEventLoop

      public ThreadPerChannelEventLoop(ThreadPerChannelEventLoopGroup parent)
      Deprecated.
  • Method Details

    • register

      public ChannelFuture register(ChannelPromise promise)
      Deprecated.
      Description copied from interface: EventLoopGroup
      Register a Channel with this EventLoop using a ChannelFuture. The passed ChannelFuture will get notified once the registration was complete and also will get returned.
      Specified by:
      register in interface EventLoopGroup
      Overrides:
      register in class SingleThreadEventLoop
    • register

      @Deprecated public ChannelFuture register(Channel channel, ChannelPromise promise)
      Deprecated.
      Description copied from interface: EventLoopGroup
      Register a Channel with this EventLoop. The passed ChannelFuture will get notified once the registration was complete and also will get returned.
      Specified by:
      register in interface EventLoopGroup
      Overrides:
      register in class SingleThreadEventLoop
    • run

      protected void run()
      Deprecated.
      Description copied from class: SingleThreadEventExecutor
      Runs the task-processing loop until SingleThreadEventExecutor.confirmShutdown() returns true.

      Implementations must not let a Throwable thrown by a task escape this method: any uncaught Throwable terminates the executor (logged at WARN and surfaced via SingleThreadEventExecutor.terminationFuture()), at which point every Channel registered with this executor stops processing I/O and new task submissions are rejected. The supplied helpers - SingleThreadEventExecutor.runAllTasks(), SingleThreadEventExecutor.runAllTasks(long), and AbstractEventExecutor.safeExecute(Runnable) - catch Throwable for you; custom loops built on SingleThreadEventExecutor.pollTask() or SingleThreadEventExecutor.takeTask() are responsible for wrapping each task invocation accordingly.

      Specified by:
      run in class SingleThreadEventExecutor
    • deregister

      protected void deregister()
      Deprecated.
    • registeredChannels

      public int registeredChannels()
      Deprecated.
      Description copied from class: SingleThreadEventLoop
      Returns the number of Channels registered with this EventLoop or -1 if operation is not supported. The returned value is not guaranteed to be exact accurate and should be viewed as a best effort.
      Overrides:
      registeredChannels in class SingleThreadEventLoop
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.