Package io.netty.channel
Class ChannelFlushPromiseNotifier
- java.lang.Object
-
- io.netty.channel.ChannelFlushPromiseNotifier
-
public final class ChannelFlushPromiseNotifier extends java.lang.Object
This implementation allows to registerChannelFuture
instances 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 theChannelPromise
s.ChannelFlushPromiseNotifier(boolean tryNotify)
Create a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ChannelFlushPromiseNotifier
add(ChannelPromise promise, int pendingDataSize)
Deprecated.ChannelFlushPromiseNotifier
add(ChannelPromise promise, long pendingDataSize)
Add aChannelPromise
to thisChannelFlushPromiseNotifier
which will be notified after the givenpendingDataSize
was reached.ChannelFlushPromiseNotifier
increaseWriteCounter(long delta)
Increase the current write counter by the given deltaChannelFlushPromiseNotifier
notifyFlushFutures()
Deprecated.usenotifyPromises()
ChannelFlushPromiseNotifier
notifyFlushFutures(java.lang.Throwable cause)
Deprecated.ChannelFlushPromiseNotifier
notifyFlushFutures(java.lang.Throwable cause1, java.lang.Throwable cause2)
Deprecated.ChannelFlushPromiseNotifier
notifyPromises()
Notify allChannelFuture
s that were registered withadd(ChannelPromise, int)
and their pendingDatasize is smaller after the current writeCounter returned bywriteCounter()
.ChannelFlushPromiseNotifier
notifyPromises(java.lang.Throwable cause)
Notify allChannelFuture
s that were registered withadd(ChannelPromise, int)
and their pendingDatasize isis smaller then the current writeCounter returned bywriteCounter()
.ChannelFlushPromiseNotifier
notifyPromises(java.lang.Throwable cause1, java.lang.Throwable cause2)
Notify allChannelFuture
s that were registered withadd(ChannelPromise, int)
and their pendingDatasize is smaller then the current writeCounter returned bywriteCounter()
using the given cause1.long
writeCounter()
Return the current write counter of thisChannelFlushPromiseNotifier
-
-
-
Constructor Detail
-
ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier(boolean tryNotify)
Create a new instance- Parameters:
tryNotify
- iftrue
theChannelPromise
s 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 theChannelPromise
s.
-
-
Method Detail
-
add
@Deprecated public ChannelFlushPromiseNotifier add(ChannelPromise promise, int pendingDataSize)
Deprecated.
-
add
public ChannelFlushPromiseNotifier add(ChannelPromise promise, long pendingDataSize)
Add aChannelPromise
to thisChannelFlushPromiseNotifier
which will be notified after the givenpendingDataSize
was 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 allChannelFuture
s that were registered withadd(ChannelPromise, int)
and their pendingDatasize is smaller after the current writeCounter returned bywriteCounter()
. After aChannelFuture
was notified it will be removed from thisChannelFlushPromiseNotifier
and so not receive anymore notification.
-
notifyFlushFutures
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures()
Deprecated.usenotifyPromises()
-
notifyPromises
public ChannelFlushPromiseNotifier notifyPromises(java.lang.Throwable cause)
Notify allChannelFuture
s that were registered withadd(ChannelPromise, int)
and their pendingDatasize isis smaller then the current writeCounter returned bywriteCounter()
. After aChannelFuture
was notified it will be removed from thisChannelFlushPromiseNotifier
and so not receive anymore notification. The rest of the remainingChannelFuture
s will be failed with the givenThrowable
. So after this operation thisChannelFutureListener
is empty.
-
notifyFlushFutures
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(java.lang.Throwable cause)
Deprecated.
-
notifyPromises
public ChannelFlushPromiseNotifier notifyPromises(java.lang.Throwable cause1, java.lang.Throwable cause2)
Notify allChannelFuture
s that were registered withadd(ChannelPromise, int)
and their pendingDatasize is smaller then the current writeCounter returned bywriteCounter()
using the given cause1. After aChannelFuture
was notified it will be removed from thisChannelFlushPromiseNotifier
and so not receive anymore notification. The rest of the remainingChannelFuture
s will be failed with the givenThrowable
. So after this operation thisChannelFutureListener
is empty.- Parameters:
cause1
- theThrowable
which will be used to fail all of theChannelFuture
s which pendingDataSize is smaller then the current writeCounter returned bywriteCounter()
cause2
- theThrowable
which will be used to fail the remainingChannelFuture
s
-
notifyFlushFutures
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(java.lang.Throwable cause1, java.lang.Throwable cause2)
Deprecated.
-
-