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.nio
  • NioEventLoopGroup

This view

  • Original page
  • New address

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

Class NioEventLoopGroup

java.lang.Object
io.netty.util.concurrent.AbstractEventExecutorGroup
io.netty.util.concurrent.MultithreadEventExecutorGroup
io.netty.channel.MultithreadEventLoopGroup
io.netty.channel.nio.NioEventLoopGroup
All Implemented Interfaces:
EventLoopGroup, EventExecutorGroup, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService

public class NioEventLoopGroup extends MultithreadEventLoopGroup
MultithreadEventLoopGroup implementations which is used for NIO Selector based Channels.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NioEventLoopGroup()
    Create a new instance using the default number of threads, the default ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    NioEventLoopGroup(int nThreads)
    Create a new instance using the specified number of threads, ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    NioEventLoopGroup(int nThreads, Executor executor)
     
    NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
     
    NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler)
     
    NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory)
     
    NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory)
     
    NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider)
     
    NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
     
    NioEventLoopGroup(int nThreads, ThreadFactory threadFactory)
    Create a new instance using the specified number of threads, the given ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider)
    Create a new instance using the specified number of threads, the given ThreadFactory and the given SelectorProvider.
    NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
     
    NioEventLoopGroup(ThreadFactory threadFactory)
    Create a new instance using the default number of threads, the given ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
  • Method Summary

    Modifier and Type
    Method
    Description
    protected EventLoop
    newChild(Executor executor, Object... args)
    Create a new EventExecutor which will later then accessible via the MultithreadEventExecutorGroup.next() method.
    void
    rebuildSelectors()
    Replaces the current Selectors of the child event loops with newly created Selectors to work around the infamous epoll 100% CPU bug.
    void
    setIoRatio(int ioRatio)
    Sets the percentage of the desired amount of time spent for I/O in the child event loops.

    Methods inherited from class MultithreadEventLoopGroup

    newDefaultThreadFactory, next, register, register, register
    Modifier and Type
    Method
    Description
    protected ThreadFactory
    newDefaultThreadFactory()
     
    EventLoop
    next()
    Returns one of the EventExecutors managed by this EventExecutorGroup.
    ChannelFuture
    register(Channel channel)
    Register a Channel with this EventLoop.
    ChannelFuture
    register(ChannelPromise promise)
    Register a Channel with this EventLoop using a ChannelFuture.
    ChannelFuture
    register(Channel channel, ChannelPromise promise)
    Deprecated.

    Methods inherited from class MultithreadEventExecutorGroup

    awaitTermination, executorCount, isShutdown, isShuttingDown, isTerminated, iterator, shutdown, shutdownGracefully, terminationFuture
    Modifier and Type
    Method
    Description
    boolean
    awaitTermination(long timeout, TimeUnit unit)
     
    final int
    executorCount()
    Return the number of EventExecutor this implementation uses.
    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()
     
    Iterator<EventExecutor>
    iterator()
     
    void
    shutdown()
    Deprecated.
    Future<?>
    shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)
    Signals this executor that the caller wants the executor to be shut down.
    Future<?>
    terminationFuture()
    Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.

    Methods inherited from class AbstractEventExecutorGroup

    execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit
    Modifier and Type
    Method
    Description
    void
    execute(Runnable command)
     
    <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)
     
    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)
     
    Future<?>
    shutdownGracefully()
    Shortcut method for EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.
    List<Runnable>
    shutdownNow()
    Deprecated.
    EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) or AbstractEventExecutorGroup.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

    • NioEventLoopGroup

      public NioEventLoopGroup()
      Create a new instance using the default number of threads, the default ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads)
      Create a new instance using the specified number of threads, ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    • NioEventLoopGroup

      public NioEventLoopGroup(ThreadFactory threadFactory)
      Create a new instance using the default number of threads, the given ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory)
      Create a new instance using the specified number of threads, the given ThreadFactory and the SelectorProvider which is returned by SelectorProvider.provider().
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider)
      Create a new instance using the specified number of threads, the given ThreadFactory and the given SelectorProvider.
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory)
    • NioEventLoopGroup

      public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory)
      Parameters:
      nThreads - the number of threads that will be used by this instance.
      executor - the Executor to use, or null if default one should be used.
      chooserFactory - the EventExecutorChooserFactory to use.
      selectorProvider - the SelectorProvider to use.
      selectStrategyFactory - the SelectStrategyFactory to use.
      rejectedExecutionHandler - the RejectedExecutionHandler to use.
      taskQueueFactory - the EventLoopTaskQueueFactory to use for SingleThreadEventExecutor.execute(Runnable), or null if default one should be used.
      tailTaskQueueFactory - the EventLoopTaskQueueFactory to use for SingleThreadEventLoop.executeAfterEventLoopIteration(Runnable), or null if default one should be used.
  • Method Details

    • setIoRatio

      public void setIoRatio(int ioRatio)
      Sets the percentage of the desired amount of time spent for I/O in the child event loops. The default value is 50, which means the event loop will try to spend the same amount of time for I/O as for non-I/O tasks.
    • rebuildSelectors

      public void rebuildSelectors()
      Replaces the current Selectors of the child event loops with newly created Selectors to work around the infamous epoll 100% CPU bug.
    • newChild

      protected EventLoop newChild(Executor executor, Object... args) throws Exception
      Description copied from class: MultithreadEventExecutorGroup
      Create a new EventExecutor which will later then accessible via the MultithreadEventExecutorGroup.next() method. This method will be called for each thread that will serve this MultithreadEventExecutorGroup.
      Specified by:
      newChild in class MultithreadEventLoopGroup
      Throws:
      Exception
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.