Home / Function/ flush() — netty Function Reference

flush() — netty Function Reference

Architecture documentation for the flush() function in FlushConsolidationHandler.java from the netty codebase.

Function java Buffer Allocators calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  7fbc654e_1d7f_5b1f_c7ad_939c24a30413["flush()"]
  2c83d6ba_1bff_324b_5825_8c26ffd14953["FlushConsolidationHandler"]
  7fbc654e_1d7f_5b1f_c7ad_939c24a30413 -->|defined in| 2c83d6ba_1bff_324b_5825_8c26ffd14953
  8725031c_7bfb_d03f_d0f0_a4da7647d2b8["FlushConsolidationHandler()"]
  8725031c_7bfb_d03f_d0f0_a4da7647d2b8 -->|calls| 7fbc654e_1d7f_5b1f_c7ad_939c24a30413
  b4f0e143_9831_d5e8_f170_2f33e1c026f7["flushNow()"]
  b4f0e143_9831_d5e8_f170_2f33e1c026f7 -->|calls| 7fbc654e_1d7f_5b1f_c7ad_939c24a30413
  84d37731_7d4c_dd16_40b5_a6526cf85dc7["channelReadComplete()"]
  7fbc654e_1d7f_5b1f_c7ad_939c24a30413 -->|calls| 84d37731_7d4c_dd16_40b5_a6526cf85dc7
  b4f0e143_9831_d5e8_f170_2f33e1c026f7["flushNow()"]
  7fbc654e_1d7f_5b1f_c7ad_939c24a30413 -->|calls| b4f0e143_9831_d5e8_f170_2f33e1c026f7
  dfa9dc35_bb08_bfe7_5a72_e922b211c05a["scheduleFlush()"]
  7fbc654e_1d7f_5b1f_c7ad_939c24a30413 -->|calls| dfa9dc35_bb08_bfe7_5a72_e922b211c05a
  style 7fbc654e_1d7f_5b1f_c7ad_939c24a30413 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/flush/FlushConsolidationHandler.java lines 121–140

    @Override
    public void flush(ChannelHandlerContext ctx) throws Exception {
        if (readInProgress) {
            // If there is still a read in progress we are sure we will see a channelReadComplete(...) call. Thus
            // we only need to flush if we reach the explicitFlushAfterFlushes limit.
            if (++flushPendingCount == explicitFlushAfterFlushes) {
                flushNow(ctx);
            }
        } else if (consolidateWhenNoReadInProgress) {
            // Flush immediately if we reach the threshold, otherwise schedule
            if (++flushPendingCount == explicitFlushAfterFlushes) {
                flushNow(ctx);
            } else {
                scheduleFlush(ctx);
            }
        } else {
            // Always flush directly
            flushNow(ctx);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does flush() do?
flush() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/flush/FlushConsolidationHandler.java.
Where is flush() defined?
flush() is defined in handler/src/main/java/io/netty/handler/flush/FlushConsolidationHandler.java at line 121.
What does flush() call?
flush() calls 3 function(s): channelReadComplete, flushNow, scheduleFlush.
What calls flush()?
flush() is called by 2 function(s): FlushConsolidationHandler, flushNow.

Analyze Your Own Codebase

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

Try Supermodel Free