Home / Function/ bytesBeforeUnwritable() — netty Function Reference

bytesBeforeUnwritable() — netty Function Reference

Architecture documentation for the bytesBeforeUnwritable() function in AbstractHttp2StreamChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d7779e1e_ca84_0a81_5300_6a4a21aa5054["bytesBeforeUnwritable()"]
  bcb58015_0c85_17e2_f1b3_0c1ad3aaa388["AbstractHttp2StreamChannel"]
  d7779e1e_ca84_0a81_5300_6a4a21aa5054 -->|defined in| bcb58015_0c85_17e2_f1b3_0c1ad3aaa388
  6bdfa940_bc40_cf8b_d070_a835a7f43634["isWritable()"]
  d7779e1e_ca84_0a81_5300_6a4a21aa5054 -->|calls| 6bdfa940_bc40_cf8b_d070_a835a7f43634
  style d7779e1e_ca84_0a81_5300_6a4a21aa5054 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java lines 411–419

    @Override
    public long bytesBeforeUnwritable() {
        // +1 because writability doesn't change until the threshold is crossed (not equal to).
        long bytes = config().getWriteBufferHighWaterMark() - totalPendingSize + 1;
        // If bytes is negative we know we are not writable, but if bytes is non-negative we have to check
        // writability. Note that totalPendingSize and isWritable() use different volatile variables that are not
        // synchronized together. totalPendingSize will be updated before isWritable().
        return bytes > 0 && isWritable() ? bytes : 0;
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does bytesBeforeUnwritable() do?
bytesBeforeUnwritable() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java.
Where is bytesBeforeUnwritable() defined?
bytesBeforeUnwritable() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java at line 411.
What does bytesBeforeUnwritable() call?
bytesBeforeUnwritable() calls 1 function(s): isWritable.

Analyze Your Own Codebase

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

Try Supermodel Free