Package io.netty.channel
Class ChannelFlushPromiseNotifier
- java.lang.Object
-
- io.netty.channel.ChannelFlushPromiseNotifier
-
public final class ChannelFlushPromiseNotifier extends java.lang.ObjectThis implementation allows to registerChannelFutureinstances which will get notified once some amount of data was written and so a checkpoint was reached.
-
-
Constructor Summary
Constructors Constructor Description ChannelFlushPromiseNotifier()Create a new instance which will useChannelPromise.setSuccess()andChannelPromise.setFailure(Throwable)to notify theChannelPromises.ChannelFlushPromiseNotifier(boolean tryNotify)Create a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ChannelFlushPromiseNotifieradd(ChannelPromise promise, int pendingDataSize)Deprecated.ChannelFlushPromiseNotifieradd(ChannelPromise promise, long pendingDataSize)Add aChannelPromiseto thisChannelFlushPromiseNotifierwhich will be notified after the givenpendingDataSizewas reached.ChannelFlushPromiseNotifierincreaseWriteCounter(long delta)Increase the current write counter by the given deltaChannelFlushPromiseNotifiernotifyFlushFutures()Deprecated.usenotifyPromises()ChannelFlushPromiseNotifiernotifyFlushFutures(java.lang.Throwable cause)Deprecated.ChannelFlushPromiseNotifiernotifyFlushFutures(java.lang.Throwable cause1, java.lang.Throwable cause2)Deprecated.ChannelFlushPromiseNotifiernotifyPromises()Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize is smaller after the current writeCounter returned bywriteCounter().ChannelFlushPromiseNotifiernotifyPromises(java.lang.Throwable cause)Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize isis smaller then the current writeCounter returned bywriteCounter().ChannelFlushPromiseNotifiernotifyPromises(java.lang.Throwable cause1, java.lang.Throwable cause2)Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize is smaller then the current writeCounter returned bywriteCounter()using the given cause1.longwriteCounter()Return the current write counter of thisChannelFlushPromiseNotifier
-
-
-
Constructor Detail
-
ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier(boolean tryNotify)
Create a new instance- Parameters:
tryNotify- iftruetheChannelPromises will get notified withChannelPromise.trySuccess()andPromise.tryFailure(Throwable). OtherwiseChannelPromise.setSuccess()andChannelPromise.setFailure(Throwable)is used
-
ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier()
Create a new instance which will useChannelPromise.setSuccess()andChannelPromise.setFailure(Throwable)to notify theChannelPromises.
-
-
Method Detail
-
add
@Deprecated public ChannelFlushPromiseNotifier add(ChannelPromise promise, int pendingDataSize)
Deprecated.
-
add
public ChannelFlushPromiseNotifier add(ChannelPromise promise, long pendingDataSize)
Add aChannelPromiseto thisChannelFlushPromiseNotifierwhich will be notified after the givenpendingDataSizewas reached.
-
increaseWriteCounter
public ChannelFlushPromiseNotifier increaseWriteCounter(long delta)
Increase the current write counter by the given delta
-
writeCounter
public long writeCounter()
Return the current write counter of thisChannelFlushPromiseNotifier
-
notifyPromises
public ChannelFlushPromiseNotifier notifyPromises()
Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize is smaller after the current writeCounter returned bywriteCounter(). After aChannelFuturewas notified it will be removed from thisChannelFlushPromiseNotifierand so not receive anymore notification.
-
notifyFlushFutures
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures()
Deprecated.usenotifyPromises()
-
notifyPromises
public ChannelFlushPromiseNotifier notifyPromises(java.lang.Throwable cause)
Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize isis smaller then the current writeCounter returned bywriteCounter(). After aChannelFuturewas notified it will be removed from thisChannelFlushPromiseNotifierand so not receive anymore notification. The rest of the remainingChannelFutures will be failed with the givenThrowable. So after this operation thisChannelFutureListeneris empty.
-
notifyFlushFutures
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(java.lang.Throwable cause)
Deprecated.
-
notifyPromises
public ChannelFlushPromiseNotifier notifyPromises(java.lang.Throwable cause1, java.lang.Throwable cause2)
Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize is smaller then the current writeCounter returned bywriteCounter()using the given cause1. After aChannelFuturewas notified it will be removed from thisChannelFlushPromiseNotifierand so not receive anymore notification. The rest of the remainingChannelFutures will be failed with the givenThrowable. So after this operation thisChannelFutureListeneris empty.- Parameters:
cause1- theThrowablewhich will be used to fail all of theChannelFutures which pendingDataSize is smaller then the current writeCounter returned bywriteCounter()cause2- theThrowablewhich will be used to fail the remainingChannelFutures
-
notifyFlushFutures
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(java.lang.Throwable cause1, java.lang.Throwable cause2)
Deprecated.
-
-