public final class ChannelFlushPromiseNotifier extends Object
ChannelFuture instances which will get notified once some amount of
data was written and so a checkpoint was reached.| Constructor and Description |
|---|
ChannelFlushPromiseNotifier()
Create a new instance which will use
ChannelPromise.setSuccess() and
ChannelPromise.setFailure(Throwable) to notify the ChannelPromises. |
ChannelFlushPromiseNotifier(boolean tryNotify)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
ChannelFlushPromiseNotifier |
add(ChannelPromise promise,
long pendingDataSize)
Add a
ChannelPromise to this ChannelFlushPromiseNotifier which will be notified after the given
pendingDataSize was reached. |
ChannelFlushPromiseNotifier |
increaseWriteCounter(long delta)
Increase the current write counter by the given delta
|
ChannelFlushPromiseNotifier |
notifyFlushFutures(Throwable cause1,
Throwable cause2)
Deprecated.
|
ChannelFlushPromiseNotifier |
notifyPromises()
Notify all
ChannelFutures that were registered with add(ChannelPromise, long) and
their pendingDatasize is smaller after the the current writeCounter returned by writeCounter(). |
ChannelFlushPromiseNotifier |
notifyPromises(Throwable cause)
Notify all
ChannelFutures that were registered with add(ChannelPromise, long) and
their pendingDatasize isis smaller then the current writeCounter returned by writeCounter(). |
ChannelFlushPromiseNotifier |
notifyPromises(Throwable cause1,
Throwable cause2)
Notify all
ChannelFutures that were registered with add(ChannelPromise, long) and
their pendingDatasize is smaller then the current writeCounter returned by writeCounter() using
the given cause1. |
long |
writeCounter()
Return the current write counter of this
ChannelFlushPromiseNotifier |
public ChannelFlushPromiseNotifier(boolean tryNotify)
tryNotify - if true the ChannelPromises will get notified with
ChannelPromise.trySuccess() and Promise.tryFailure(Throwable).
Otherwise ChannelPromise.setSuccess() and ChannelPromise.setFailure(Throwable)
is usedpublic ChannelFlushPromiseNotifier()
ChannelPromise.setSuccess() and
ChannelPromise.setFailure(Throwable) to notify the ChannelPromises.public ChannelFlushPromiseNotifier add(ChannelPromise promise, long pendingDataSize)
ChannelPromise to this ChannelFlushPromiseNotifier which will be notified after the given
pendingDataSize was reached.public ChannelFlushPromiseNotifier increaseWriteCounter(long delta)
public long writeCounter()
ChannelFlushPromiseNotifierpublic ChannelFlushPromiseNotifier notifyPromises()
ChannelFutures that were registered with add(ChannelPromise, long) and
their pendingDatasize is smaller after the the current writeCounter returned by writeCounter().
After a ChannelFuture was notified it will be removed from this ChannelFlushPromiseNotifier and
so not receive anymore notification.public ChannelFlushPromiseNotifier notifyPromises(Throwable cause)
ChannelFutures that were registered with add(ChannelPromise, long) and
their pendingDatasize isis smaller then the current writeCounter returned by writeCounter().
After a ChannelFuture was notified it will be removed from this ChannelFlushPromiseNotifier and
so not receive anymore notification.
The rest of the remaining ChannelFutures will be failed with the given Throwable.
So after this operation this ChannelFutureListener is empty.public ChannelFlushPromiseNotifier notifyPromises(Throwable cause1, Throwable cause2)
ChannelFutures that were registered with add(ChannelPromise, long) and
their pendingDatasize is smaller then the current writeCounter returned by writeCounter() using
the given cause1.
After a ChannelFuture was notified it will be removed from this ChannelFlushPromiseNotifier and
so not receive anymore notification.
The rest of the remaining ChannelFutures will be failed with the given Throwable.
So after this operation this ChannelFutureListener is empty.cause1 - the Throwable which will be used to fail all of the ChannelFutures whichs
pendingDataSize is smaller then the current writeCounter returned by writeCounter()cause2 - the Throwable which will be used to fail the remaining ChannelFutures@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(Throwable cause1, Throwable cause2)
notifyPromises(Throwable, Throwable)Copyright © 2008–2015 The Netty Project. All rights reserved.