Class ChannelTaskSerializer


  • public class ChannelTaskSerializer
    extends java.lang.Object
    The purpose of this class is to execute tasks in series without overlap, even if the executeTask(Consumer, ChannelFutureListener) method is called before the completion if the previous tasks. The next task is not started until after the provided ChannelFutureListener returns. If the task fails to complete by completing the ChannelPromise, the serializer becomes blocked. It may be possible to add a PhantomReference to detect when the ChannelPromise completion has been lost and to enact some kind of recovery.
    • Constructor Summary

      Constructors 
      Constructor Description
      ChannelTaskSerializer​(io.netty.channel.ChannelHandlerContext ctx)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void executeTask​(java.util.function.Consumer<io.netty.channel.ChannelPromise> task, io.netty.channel.ChannelFutureListener listener)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChannelTaskSerializer

        public ChannelTaskSerializer​(@Nonnull
                                     io.netty.channel.ChannelHandlerContext ctx)
    • Method Detail

      • executeTask

        public void executeTask​(@Nonnull
                                java.util.function.Consumer<io.netty.channel.ChannelPromise> task,
                                @Nonnull
                                io.netty.channel.ChannelFutureListener listener)