Home / Function/ ChannelPromise() — netty Function Reference

ChannelPromise() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  eadb4188_9221_af6d_f14a_53fc875c5959["ChannelPromise()"]
  6a8a567c_977e_e3a6_f305_671f38945583["Http2TestUtil"]
  eadb4188_9221_af6d_f14a_53fc875c5959 -->|defined in| 6a8a567c_977e_e3a6_f305_671f38945583
  style eadb4188_9221_af6d_f14a_53fc875c5959 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2TestUtil.java lines 275–323

    static ChannelPromise newVoidPromise(final Channel channel) {
        return new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE) {
            @Override
            public ChannelPromise addListener(
                    GenericFutureListener<? extends Future<? super Void>> listener) {
                fail();
                return null;
            }

            @Override
            public ChannelPromise addListeners(
                    GenericFutureListener<? extends Future<? super Void>>... listeners) {
                fail();
                return null;
            }

            @Override
            public boolean isVoid() {
                return true;
            }

            @Override
            public boolean tryFailure(Throwable cause) {
                channel().pipeline().fireExceptionCaught(cause);
                return true;
            }

            @Override
            public ChannelPromise setFailure(Throwable cause) {
                tryFailure(cause);
                return this;
            }

            @Override
            public ChannelPromise unvoid() {
                ChannelPromise promise =
                        new DefaultChannelPromise(channel, ImmediateEventExecutor.INSTANCE);
                promise.addListener(new ChannelFutureListener() {
                    @Override
                    public void operationComplete(ChannelFuture future) throws Exception {
                        if (!future.isSuccess()) {
                            channel().pipeline().fireExceptionCaught(future.cause());
                        }
                    }
                });
                return promise;
            }
        };
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free