Home / Function/ sendAllValid() — netty Function Reference

sendAllValid() — netty Function Reference

Architecture documentation for the sendAllValid() function in GlobalTrafficShapingHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  671aee98_3b6a_90b2_4e2d_667b72384afa["sendAllValid()"]
  25ae99c4_4bb1_9893_ce25_fa54995d6af1["GlobalTrafficShapingHandler"]
  671aee98_3b6a_90b2_4e2d_667b72384afa -->|defined in| 25ae99c4_4bb1_9893_ce25_fa54995d6af1
  54f6e54e_8782_c399_da86_551bdcf1fafe["submitWrite()"]
  54f6e54e_8782_c399_da86_551bdcf1fafe -->|calls| 671aee98_3b6a_90b2_4e2d_667b72384afa
  style 671aee98_3b6a_90b2_4e2d_667b72384afa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/traffic/GlobalTrafficShapingHandler.java lines 378–400

    private void sendAllValid(final ChannelHandlerContext ctx, final PerChannel perChannel, final long now) {
        // write operations need synchronization
        synchronized (perChannel) {
            ToSend newToSend = perChannel.messagesQueue.pollFirst();
            for (; newToSend != null; newToSend = perChannel.messagesQueue.pollFirst()) {
                if (newToSend.relativeTimeAction <= now) {
                    long size = newToSend.size;
                    trafficCounter.bytesRealWriteFlowControl(size);
                    perChannel.queueSize -= size;
                    queuesSize.addAndGet(-size);
                    ctx.write(newToSend.toSend, newToSend.promise);
                    perChannel.lastWriteTimestamp = now;
                } else {
                    perChannel.messagesQueue.addFirst(newToSend);
                    break;
                }
            }
            if (perChannel.messagesQueue.isEmpty()) {
                releaseWriteSuspended(ctx);
            }
        }
        ctx.flush();
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does sendAllValid() do?
sendAllValid() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/traffic/GlobalTrafficShapingHandler.java.
Where is sendAllValid() defined?
sendAllValid() is defined in handler/src/main/java/io/netty/handler/traffic/GlobalTrafficShapingHandler.java at line 378.
What calls sendAllValid()?
sendAllValid() is called by 1 function(s): submitWrite.

Analyze Your Own Codebase

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

Try Supermodel Free