Class ChannelFlushPromiseNotifier
java.lang.Object
io.netty.channel.ChannelFlushPromiseNotifier
This implementation allows to register
ChannelFuture instances which will get notified once some amount of
data was written and so a checkpoint was reached.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance which will useChannelPromise.setSuccess()andChannelPromise.setFailure(Throwable)to notify theChannelPromises.ChannelFlushPromiseNotifier(boolean tryNotify) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionadd(ChannelPromise promise, int pendingDataSize) Deprecated.add(ChannelPromise promise, long pendingDataSize) Add aChannelPromiseto thisChannelFlushPromiseNotifierwhich will be notified after the givenpendingDataSizewas reached.increaseWriteCounter(long delta) Increase the current write counter by the given deltaDeprecated.usenotifyPromises()notifyFlushFutures(Throwable cause) Deprecated.notifyFlushFutures(Throwable cause1, Throwable cause2) Deprecated.Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize is smaller after the current writeCounter returned bywriteCounter().notifyPromises(Throwable cause) Notify allChannelFutures that were registered withadd(ChannelPromise, int)and their pendingDatasize isis smaller then the current writeCounter returned bywriteCounter().notifyPromises(Throwable cause1, 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.longReturn the current write counter of thisChannelFlushPromiseNotifier
-
Constructor Details
-
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 Details
-
add
Deprecated. -
add
Add aChannelPromiseto thisChannelFlushPromiseNotifierwhich will be notified after the givenpendingDataSizewas reached. -
increaseWriteCounter
Increase the current write counter by the given delta -
writeCounter
public long writeCounter()Return the current write counter of thisChannelFlushPromiseNotifier -
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.usenotifyPromises() -
notifyPromises
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. -
notifyPromises
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(Throwable cause1, Throwable cause2) Deprecated.
-
add(ChannelPromise, long)