public final class ChannelFlushPromiseNotifier
extends java.lang.Object
ChannelFuture实例,一旦写入了一定数量的数据,就会得到通知,并且达到了检查点。
| Constructor and Description |
|---|
ChannelFlushPromiseNotifier()
|
ChannelFlushPromiseNotifier(boolean tryNotify)
创建一个新的实例
|
public ChannelFlushPromiseNotifier(boolean tryNotify)
tryNotify - 如果true ChannelPromise s将收到通知ChannelPromise.trySuccess()和Promise.tryFailure(Throwable) 。
否则使用ChannelPromise.setSuccess()和ChannelPromise.setFailure(Throwable)
public ChannelFlushPromiseNotifier()
@Deprecated public ChannelFlushPromiseNotifier add(ChannelPromise promise, int pendingDataSize)
add(ChannelPromise, long)
public ChannelFlushPromiseNotifier add(ChannelPromise promise, long pendingDataSize)
ChannelPromise添加到此ChannelFlushPromiseNotifier ,在达到给定的pendingDataSize后会通知您。
public ChannelFlushPromiseNotifier increaseWriteCounter(long delta)
public long writeCounter()
ChannelFlushPromiseNotifier的当前写入计数器
public ChannelFlushPromiseNotifier notifyPromises()
ChannelFuture s已注册add(ChannelPromise, int),并且在当前writeCounter返回writeCounter()之后,其pendingDatasize更小。
在通知ChannelFuture之后,它将从此ChannelFlushPromiseNotifier中删除,因此不会再收到通知。
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures()
notifyPromises()
public ChannelFlushPromiseNotifier notifyPromises(java.lang.Throwable cause)
ChannelFuture s已注册add(ChannelPromise, int),并且其pendingDatasize isis小于当前writeCounter返回的writeCounter() 。
在通知ChannelFuture后,它将从此ChannelFlushPromiseNotifier中删除,因此不会再收到通知。
其余的ChannelFuture s将会以给定的Throwable失败。
所以在这个操作之后,这个ChannelFutureListener是空的。
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(java.lang.Throwable cause)
notifyPromises(Throwable)
public ChannelFlushPromiseNotifier notifyPromises(java.lang.Throwable cause1, java.lang.Throwable cause2)
ChannelFuture个认为登记与S add(ChannelPromise, int)及其pendingDatasize较小然后返回当前writeCounter writeCounter()使用给定的原因1。
在通知ChannelFuture后,它将从此ChannelFlushPromiseNotifier中删除,因此不会再收到通知。
剩余的ChannelFuture的其余部分将以给定的Throwable失败。
所以在这个操作之后,这个ChannelFutureListener是空的。
cause1 - Throwable将用于使所有ChannelFuture失败,其中pendingDataSize小于writeCounter()返回的当前writeCounter
cause2 - Throwable将用于使剩余的ChannelFuture失败
@Deprecated public ChannelFlushPromiseNotifier notifyFlushFutures(java.lang.Throwable cause1, java.lang.Throwable cause2)
Copyright © 2008–2018 The Netty Project. All rights reserved.