Package com.linkedin.alpini.netty4.misc
Class ChannelTaskSerializer
- java.lang.Object
-
- com.linkedin.alpini.netty4.misc.ChannelTaskSerializer
-
public class ChannelTaskSerializer extends java.lang.Object
The purpose of this class is to execute tasks in series without overlap, even if theexecuteTask(Consumer, ChannelFutureListener)
method is called before the completion if the previous tasks. The next task is not started until after the providedChannelFutureListener
returns. If the task fails to complete by completing theChannelPromise
, 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)
-