Home / Function/ ChannelPromise() — netty Function Reference

ChannelPromise() — netty Function Reference

Architecture documentation for the ChannelPromise() function in Http2ControlFrameLimitEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  43c80ac4_4cee_af50_5027_266b1d11e09a["ChannelPromise()"]
  f941964b_67fa_416a_683a_69abc95d93e2["Http2ControlFrameLimitEncoder"]
  43c80ac4_4cee_af50_5027_266b1d11e09a -->|defined in| f941964b_67fa_416a_683a_69abc95d93e2
  style 43c80ac4_4cee_af50_5027_266b1d11e09a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ControlFrameLimitEncoder.java lines 83–107

    private ChannelPromise handleOutstandingControlFrames(ChannelHandlerContext ctx, ChannelPromise promise) {
        if (!limitReached) {
            if (outstandingControlFrames == maxOutstandingControlFrames) {
                // Let's try to flush once as we may be able to flush some of the control frames.
                ctx.flush();
            }
            if (outstandingControlFrames == maxOutstandingControlFrames) {
                limitReached = true;
                Http2Exception exception = Http2Exception.connectionError(Http2Error.ENHANCE_YOUR_CALM,
                        "Maximum number %d of outstanding control frames reached", maxOutstandingControlFrames);
                logger.info("{} Maximum number {} of outstanding control frames reached, closing channel.",
                        ctx.channel(), maxOutstandingControlFrames, exception);

                // First notify the Http2LifecycleManager and then close the connection.
                lifecycleManager.onError(ctx, true, exception);
                ctx.close();
            }
            outstandingControlFrames++;

            // We did not reach the limit yet, add the listener to decrement the number of outstanding control frames
            // once the promise was completed
            return promise.unvoid().addListener(outstandingControlFramesListener);
        }
        return promise;
    }

Domain

Subdomains

Frequently Asked Questions

What does ChannelPromise() do?
ChannelPromise() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ControlFrameLimitEncoder.java.
Where is ChannelPromise() defined?
ChannelPromise() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ControlFrameLimitEncoder.java at line 83.

Analyze Your Own Codebase

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

Try Supermodel Free