Home / Function/ addFlush() — netty Function Reference

addFlush() — netty Function Reference

Architecture documentation for the addFlush() function in ChannelOutboundBuffer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  064bcac5_7f92_8d78_e146_94926c257464["addFlush()"]
  509b1bc5_7cdc_9ee4_03d9_31eb2203d807["ChannelOutboundBuffer"]
  064bcac5_7f92_8d78_e146_94926c257464 -->|defined in| 509b1bc5_7cdc_9ee4_03d9_31eb2203d807
  857fc3b4_246b_e6ea_c28f_4628ee8724a7["cancel()"]
  064bcac5_7f92_8d78_e146_94926c257464 -->|calls| 857fc3b4_246b_e6ea_c28f_4628ee8724a7
  9442861d_ae43_c572_95ea_8e92ddbb709f["decrementPendingOutboundBytes()"]
  064bcac5_7f92_8d78_e146_94926c257464 -->|calls| 9442861d_ae43_c572_95ea_8e92ddbb709f
  style 064bcac5_7f92_8d78_e146_94926c257464 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java lines 146–170

    public void addFlush() {
        // There is no need to process all entries if there was already a flush before and no new messages
        // where added in the meantime.
        //
        // See https://github.com/netty/netty/issues/2577
        Entry entry = unflushedEntry;
        if (entry != null) {
            if (flushedEntry == null) {
                // there is no flushedEntry yet, so start with the entry
                flushedEntry = entry;
            }
            do {
                flushed ++;
                if (!entry.promise.setUncancellable()) {
                    // Was cancelled so make sure we free up memory and notify about the freed bytes
                    int pending = entry.cancel();
                    decrementPendingOutboundBytes(pending, false, true);
                }
                entry = entry.next;
            } while (entry != null);

            // All flushed so reset unflushedEntry
            unflushedEntry = null;
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does addFlush() do?
addFlush() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java.
Where is addFlush() defined?
addFlush() is defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java at line 146.
What does addFlush() call?
addFlush() calls 2 function(s): cancel, decrementPendingOutboundBytes.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free