public final class PendingWriteQueue extends Object
Channel
, so that
the pending write operations are also considered to determine the writability.Constructor and Description |
---|
PendingWriteQueue(Channel channel) |
PendingWriteQueue(ChannelHandlerContext ctx) |
Modifier and Type | Method and Description |
---|---|
void |
add(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.
|
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(Throwable cause)
Remove a pending write operation and fail it with the given
Throwable . |
void |
removeAndFailAll(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
ChannelOutboundInvoker.write(Object, ChannelPromise) . |
ChannelFuture |
removeAndWriteAll()
Remove all pending write operation and performs them via
ChannelOutboundInvoker.write(Object, ChannelPromise) . |
int |
size()
Returns the number of pending write operations.
|
public PendingWriteQueue(ChannelHandlerContext ctx)
public PendingWriteQueue(Channel channel)
public boolean isEmpty()
true
if there are no pending write operations left in this queue.public int size()
public long bytes()
public void add(Object msg, ChannelPromise promise)
msg
and ChannelPromise
.public ChannelFuture removeAndWriteAll()
ChannelOutboundInvoker.write(Object, ChannelPromise)
.ChannelFuture
if something was written and null
if the PendingWriteQueue
is empty.public void removeAndFailAll(Throwable cause)
Throwable
. The message will be released
via ReferenceCountUtil.safeRelease(Object)
.public void removeAndFail(Throwable cause)
Throwable
. The message will be released via
ReferenceCountUtil.safeRelease(Object)
.public ChannelFuture removeAndWrite()
ChannelOutboundInvoker.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 Object current()
null
if empty.Copyright © 2008–2024 The Netty Project. All rights reserved.