Home / Function/ submitWrite() — netty Function Reference

submitWrite() — netty Function Reference

Architecture documentation for the submitWrite() function in ChannelTrafficShapingHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1b713933_a184_93c1_9ea9_dd7bde595461["submitWrite()"]
  3ab3cf0d_ce70_e3dd_bab1_dbf87d133f02["ChannelTrafficShapingHandler"]
  1b713933_a184_93c1_9ea9_dd7bde595461 -->|defined in| 3ab3cf0d_ce70_e3dd_bab1_dbf87d133f02
  bea7377f_504b_3a85_ac8b_17f6a9777578["ToSend()"]
  1b713933_a184_93c1_9ea9_dd7bde595461 -->|calls| bea7377f_504b_3a85_ac8b_17f6a9777578
  e4f33061_39c5_e7d9_db16_146de71ad694["sendAllValid()"]
  1b713933_a184_93c1_9ea9_dd7bde595461 -->|calls| e4f33061_39c5_e7d9_db16_146de71ad694
  style 1b713933_a184_93c1_9ea9_dd7bde595461 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java lines 177–201

    @Override
    void submitWrite(final ChannelHandlerContext ctx, final Object msg,
            final long size, final long delay, final long now,
            final ChannelPromise promise) {
        final ToSend newToSend;
        // write order control
        synchronized (this) {
            if (delay == 0 && messagesQueue.isEmpty()) {
                trafficCounter.bytesRealWriteFlowControl(size);
                ctx.write(msg, promise);
                return;
            }
            newToSend = new ToSend(delay + now, msg, promise);
            messagesQueue.addLast(newToSend);
            queueSize += size;
            checkWriteSuspend(ctx, delay, queueSize);
        }
        final long futureNow = newToSend.relativeTimeAction;
        ctx.executor().schedule(new Runnable() {
            @Override
            public void run() {
                sendAllValid(ctx, futureNow);
            }
        }, delay, TimeUnit.MILLISECONDS);
    }

Domain

Subdomains

Frequently Asked Questions

What does submitWrite() do?
submitWrite() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java.
Where is submitWrite() defined?
submitWrite() is defined in handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java at line 177.
What does submitWrite() call?
submitWrite() calls 2 function(s): ToSend, sendAllValid.

Analyze Your Own Codebase

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

Try Supermodel Free