Class LocalThreadEventLoopGroup<E extends io.netty.channel.MultithreadEventLoopGroup>

java.lang.Object
io.netty.util.concurrent.AbstractEventExecutorGroup
io.netty.util.concurrent.MultithreadEventExecutorGroup
io.netty.channel.MultithreadEventLoopGroup
com.linkedin.alpini.netty4.misc.LocalThreadEventLoopGroup<E>
All Implemented Interfaces:
SingleThreadEventLoopGroupSupplier, io.netty.channel.EventLoopGroup, io.netty.util.concurrent.EventExecutorGroup, Iterable<io.netty.util.concurrent.EventExecutor>, Executor, ExecutorService, ScheduledExecutorService

public class LocalThreadEventLoopGroup<E extends io.netty.channel.MultithreadEventLoopGroup> extends io.netty.channel.MultithreadEventLoopGroup implements SingleThreadEventLoopGroupSupplier
A specialised EventLoopGroup which the MultithreadEventLoopGroup.next() method prefers to return an EventLoop for the current thread, if the current thread is a thread of the wrapped MultithreadEventLoopGroup.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    awaitTermination(long timeout, TimeUnit unit)
     
    boolean
     
    boolean
     
    boolean
     
    protected io.netty.channel.EventLoop
    newChild(Executor executor, Object... args)
     
    io.netty.util.concurrent.Future<?>
    shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)
     
    io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup>
    Return a EventLoopGroup which represents a single thread.
    io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup>
    singleThreadGroup(io.netty.channel.EventLoop executor)
    Return a EventLoopGroup which represents a single thread.
    io.netty.util.concurrent.Future<?>
     

    Methods inherited from class io.netty.channel.MultithreadEventLoopGroup

    newDefaultThreadFactory, next, register, register, register

    Methods inherited from class io.netty.util.concurrent.MultithreadEventExecutorGroup

    executorCount, iterator, shutdown

    Methods inherited from class io.netty.util.concurrent.AbstractEventExecutorGroup

    execute, invokeAll, invokeAll, invokeAny, invokeAny, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.netty.util.concurrent.EventExecutorGroup

    iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownNow, submit, submit, submit

    Methods inherited from interface io.netty.channel.EventLoopGroup

    next, register, register, register

    Methods inherited from interface java.util.concurrent.Executor

    execute

    Methods inherited from interface java.util.concurrent.ExecutorService

    invokeAll, invokeAll, invokeAny, invokeAny

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • LocalThreadEventLoopGroup

      public LocalThreadEventLoopGroup(@Nonnull E executor)
  • Method Details

    • singleThreadGroup

      @Nonnull public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup()
      Return a EventLoopGroup which represents a single thread.
      Specified by:
      singleThreadGroup in interface SingleThreadEventLoopGroupSupplier
      Returns:
      future of EventLoopGroup
    • singleThreadGroup

      @Nonnull public io.netty.util.concurrent.Future<io.netty.channel.EventLoopGroup> singleThreadGroup(@Nonnull io.netty.channel.EventLoop executor)
      Return a EventLoopGroup which represents a single thread.
      Specified by:
      singleThreadGroup in interface SingleThreadEventLoopGroupSupplier
      Returns:
      future of EventLoopGroup
    • newChild

      protected io.netty.channel.EventLoop newChild(Executor executor, Object... args) throws Exception
      Specified by:
      newChild in class io.netty.channel.MultithreadEventLoopGroup
      Throws:
      Exception
    • shutdownGracefully

      public io.netty.util.concurrent.Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)
      Specified by:
      shutdownGracefully in interface io.netty.util.concurrent.EventExecutorGroup
      Overrides:
      shutdownGracefully in class io.netty.util.concurrent.MultithreadEventExecutorGroup
    • terminationFuture

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

      public boolean isShuttingDown()
      Specified by:
      isShuttingDown in interface io.netty.util.concurrent.EventExecutorGroup
      Overrides:
      isShuttingDown in class io.netty.util.concurrent.MultithreadEventExecutorGroup
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface ExecutorService
      Overrides:
      isShutdown in class io.netty.util.concurrent.MultithreadEventExecutorGroup
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface ExecutorService
      Overrides:
      isTerminated in class io.netty.util.concurrent.MultithreadEventExecutorGroup
    • awaitTermination

      public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface ExecutorService
      Overrides:
      awaitTermination in class io.netty.util.concurrent.MultithreadEventExecutorGroup
      Throws:
      InterruptedException