public final class PendingWriteQueue
extends java.lang.Object
Channel
, so that
the pending write operations are also considered to determine the writability.构造器和说明 |
---|
PendingWriteQueue(ChannelHandlerContext ctx) |
限定符和类型 | 方法和说明 |
---|---|
void |
add(java.lang.Object msg,
ChannelPromise promise)
Add the given
msg and ChannelPromise . |
long |
bytes()
Returns the total number of bytes that are pending because of pending messages.
|
java.lang.Object |
current()
Return the current message or
null if empty. |
boolean |
isEmpty()
Returns
true if there are no pending write operations left in this queue. |
ChannelPromise |
remove()
Removes a pending write operation and release it's message via
ReferenceCountUtil.safeRelease(Object) . |
void |
removeAndFail(java.lang.Throwable cause)
Remove a pending write operation and fail it with the given
Throwable . |
void |
removeAndFailAll(java.lang.Throwable cause)
Remove all pending write operation and fail them with the given
Throwable . |
ChannelFuture |
removeAndWrite()
Removes a pending write operation and performs it via
ChannelHandlerContext.write(Object, ChannelPromise) . |
ChannelFuture |
removeAndWriteAll()
Remove all pending write operation and performs them via
ChannelHandlerContext.write(Object, ChannelPromise) . |
int |
size()
Returns the number of pending write operations.
|
public PendingWriteQueue(ChannelHandlerContext ctx)
public boolean isEmpty()
true
if there are no pending write operations left in this queue.public int size()
public long bytes()
public void add(java.lang.Object msg, ChannelPromise promise)
msg
and ChannelPromise
.public ChannelFuture removeAndWriteAll()
ChannelHandlerContext.write(Object, ChannelPromise)
.ChannelFuture
if something was written and null
if the PendingWriteQueue
is empty.public void removeAndFailAll(java.lang.Throwable cause)
Throwable
. The message will be released
via ReferenceCountUtil.safeRelease(Object)
.public void removeAndFail(java.lang.Throwable cause)
Throwable
. The message will be released via
ReferenceCountUtil.safeRelease(Object)
.public ChannelFuture removeAndWrite()
ChannelHandlerContext.write(Object, ChannelPromise)
.ChannelFuture
if something was written and null
if the PendingWriteQueue
is empty.public ChannelPromise remove()
ReferenceCountUtil.safeRelease(Object)
.ChannelPromise
of the pending write or null
if the queue is empty.public java.lang.Object current()
null
if empty.