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 ChannelPromise s. |
ChannelFlushPromiseNotifier(boolean tryNotify)
Create a new instance
|
Modifier and Type | Method and Description |
---|---|
ChannelFlushPromiseNotifier |
add(ChannelPromise promise,
int pendingDataSize)
Deprecated.
|
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()
Deprecated.
use
notifyPromises() |
ChannelFlushPromiseNotifier |
notifyFlushFutures(Throwable cause)
Deprecated.
|
ChannelFlushPromiseNotifier |
notifyFlushFutures(Throwable cause1,
Throwable cause2)
Deprecated.
|
ChannelFlushPromiseNotifier |
notifyPromises()
Notify all
ChannelFuture s that were registered with add(ChannelPromise, int) and
their pendingDatasize is smaller after the current writeCounter returned by writeCounter() . |
ChannelFlushPromiseNotifier |
notifyPromises(Throwable cause)
Notify all
ChannelFuture s that were registered with add(ChannelPromise, int) and
their pendingDatasize isis smaller then the current writeCounter returned by writeCounter() . |
ChannelFlushPromiseNotifier |
notifyPromises(Throwable cause1,
Throwable cause2)
Notify all
ChannelFuture s that were registered with add(ChannelPromise, int) 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 ChannelPromise
s 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 ChannelPromise
s.@Deprecated public ChannelFlushPromiseNotifier add(ChannelPromise promise, int pendingDataSize)
add(ChannelPromise, long)
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()
ChannelFlushPromiseNotifier
public ChannelFlushPromiseNotifier notifyPromises()
ChannelFuture
s that were registered with add(ChannelPromise, int)
and
their pendingDatasize is smaller after the current writeCounter returned by writeCounter()
.
After a ChannelFuture
was notified it will be removed from this ChannelFlushPromiseNotifier
and
so not receive anymore notification.@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures()
notifyPromises()
public ChannelFlushPromiseNotifier notifyPromises(Throwable cause)
ChannelFuture
s that were registered with add(ChannelPromise, int)
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 ChannelFuture
s will be failed with the given Throwable
.
So after this operation this ChannelFutureListener
is empty.@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(Throwable cause)
notifyPromises(Throwable)
public ChannelFlushPromiseNotifier notifyPromises(Throwable cause1, Throwable cause2)
ChannelFuture
s that were registered with add(ChannelPromise, int)
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 ChannelFuture
s 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 ChannelFuture
s which
pendingDataSize is smaller then the current writeCounter returned by writeCounter()
cause2
- the Throwable
which will be used to fail the remaining ChannelFuture
s@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(Throwable cause1, Throwable cause2)
notifyPromises(Throwable, Throwable)
Copyright © 2008–2024 The Netty Project. All rights reserved.