Top Description Inners Fields Constructors Methods
io.netty5.channel

pack-priv final Class ChannelOutboundBuffer

extends Object
Class Inheritance
Imports
io.netty5.util.concurrent.EventExecutor, .Promise, io.netty5.util.internal.ObjectPool, .ObjectPool.Handle, .PromiseNotificationUtil, .SilentDispose, .SystemPropertyUtil, io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.util.function.Function, .Predicate

(Transport implementors only) an internal data structure used by AbstractChannel to store its pending outbound write requests.

All methods must be called by a transport implementation from an I/O thread, except the following ones:

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private boolean
private final EventExecutor
private int
private ChannelOutboundBuffer.Entry
private boolean
private static final InternalLogger
private ChannelOutboundBuffer.Entry
private volatile long
private ChannelOutboundBuffer.Entry

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addFlush()

Add a flush to this ChannelOutboundBuffer.

pack-priv void
addMessage(Object msg, int size, Promise<Void> promise)

Add given message to this ChannelOutboundBuffer.

private void
close(final Throwable cause)

pack-priv Object
current()

Return the current message to write or null if nothing was flushed before and so is ready to be written.

private void
pack-priv void
pack-priv void
failFlushedAndClose(Throwable failCause, Throwable closeCause)

pack-priv void
forEachFlushedMessage(Predicate<Object> processor)

Call Function#apply(Object) for each flushed message in this ChannelOutboundBuffer until Function#apply(Object) returns Boolean#FALSE or there are no more flushed messages to process.

private void
pack-priv boolean
isEmpty()

Returns true if there are flushed messages in this ChannelOutboundBuffer or false otherwise.

private boolean
pack-priv boolean
remove()

Will remove the current message, mark its Promise as success and return true.

pack-priv boolean
remove(Throwable cause)

Will remove the current message, mark its Promise as failure using the given Throwable and return true.

private boolean
private void
private static void
safeFail(Promise<Void> promise, Throwable cause)

private static void
pack-priv int
size()

Returns the number of flushed messages in this ChannelOutboundBuffer.

pack-priv long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHANNEL_OUTBOUND_BUFFER_ENTRY_OVERHEADback to summary
pack-priv static final int CHANNEL_OUTBOUND_BUFFER_ENTRY_OVERHEAD
closedback to summary
private boolean closed
executorback to summary
private final EventExecutor executor
flushedback to summary
private int flushed
flushedEntryback to summary
private ChannelOutboundBuffer.Entry flushedEntry
inFailback to summary
private boolean inFail
loggerback to summary
private static final InternalLogger logger
tailEntryback to summary
private ChannelOutboundBuffer.Entry tailEntry
totalPendingSizeback to summary
private volatile long totalPendingSize
unflushedEntryback to summary
private ChannelOutboundBuffer.Entry unflushedEntry

Constructor Detail

ChannelOutboundBufferback to summary
pack-priv ChannelOutboundBuffer(EventExecutor executor)
Annotations
@SuppressWarnings:UnusedDeclaration

Method Detail

addFlushback to summary
pack-priv void addFlush()

Add a flush to this ChannelOutboundBuffer. This means all previous added messages are marked as flushed and so you will be able to handle them.

addMessageback to summary
pack-priv void addMessage(Object msg, int size, Promise<Void> promise)

Add given message to this ChannelOutboundBuffer. The given Promise will be notified once the message was written.

closeback to summary
private void close(final Throwable cause)
currentback to summary
pack-priv Object current()

Return the current message to write or null if nothing was flushed before and so is ready to be written.

decrementPendingOutboundBytesback to summary
private void decrementPendingOutboundBytes(long size)
failFlushedback to summary
pack-priv void failFlushed(Throwable cause)
failFlushedAndCloseback to summary
pack-priv void failFlushedAndClose(Throwable failCause, Throwable closeCause)
forEachFlushedMessageback to summary
pack-priv void forEachFlushedMessage(Predicate<Object> processor)

Call Function#apply(Object) for each flushed message in this ChannelOutboundBuffer until Function#apply(Object) returns Boolean#FALSE or there are no more flushed messages to process.

incrementPendingOutboundBytesback to summary
private void incrementPendingOutboundBytes(long size)
isEmptyback to summary
pack-priv boolean isEmpty()

Returns true if there are flushed messages in this ChannelOutboundBuffer or false otherwise.

isFlushedEntryback to summary
private boolean isFlushedEntry(ChannelOutboundBuffer.Entry e)
removeback to summary
pack-priv boolean remove()

Will remove the current message, mark its Promise as success and return true. If no flushed message exists at the time this method is called it will return false to signal that no more messages are ready to be handled.

removeback to summary
pack-priv boolean remove(Throwable cause)

Will remove the current message, mark its Promise as failure using the given Throwable and return true. If no flushed message exists at the time this method is called it will return false to signal that no more messages are ready to be handled.

remove0back to summary
private boolean remove0(Throwable cause)
removeEntryback to summary
private void removeEntry(ChannelOutboundBuffer.Entry e)
safeFailback to summary
private static void safeFail(Promise<Void> promise, Throwable cause)
safeSuccessback to summary
private static void safeSuccess(Promise<Void> promise)
sizeback to summary
pack-priv int size()

Returns the number of flushed messages in this ChannelOutboundBuffer.

totalPendingWriteBytesback to summary
pack-priv long totalPendingWriteBytes()
io.netty5.channel back to summary

private final Class ChannelOutboundBuffer.Entry

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv boolean
private final ObjectPool.Handle<ChannelOutboundBuffer.Entry>
pack-priv Object
pack-priv ChannelOutboundBuffer.Entry
pack-priv int
pack-priv Promise<Void>
private static final ObjectPool<ChannelOutboundBuffer.Entry>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
pack-priv static ChannelOutboundBuffer.Entry
newInstance(Object msg, int size, Promise<Void> promise)

pack-priv void
pack-priv ChannelOutboundBuffer.Entry
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cancelledback to summary
pack-priv boolean cancelled
handleback to summary
private final ObjectPool.Handle<ChannelOutboundBuffer.Entry> handle
msgback to summary
pack-priv Object msg
nextback to summary
pack-priv ChannelOutboundBuffer.Entry next
pendingSizeback to summary
pack-priv int pendingSize
promiseback to summary
pack-priv Promise<Void> promise
RECYCLERback to summary
private static final ObjectPool<ChannelOutboundBuffer.Entry> RECYCLER

Constructor Detail

Entryback to summary
private Entry(ObjectPool.Handle<ChannelOutboundBuffer.Entry> handle)

Method Detail

cancelback to summary
pack-priv int cancel()
newInstanceback to summary
pack-priv static ChannelOutboundBuffer.Entry newInstance(Object msg, int size, Promise<Void> promise)
recycleback to summary
pack-priv void recycle()
recycleAndGetNextback to summary
pack-priv ChannelOutboundBuffer.Entry recycleAndGetNext()