Home / Function/ closeStreamInFlowControlledError() — netty Function Reference

closeStreamInFlowControlledError() — netty Function Reference

Architecture documentation for the closeStreamInFlowControlledError() function in DefaultHttp2RemoteFlowControllerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  111a72eb_db91_694e_e2ed_66dfcaea4144["closeStreamInFlowControlledError()"]
  f8fd7697_92d4_6455_4dd8_09a33ac81a6f["DefaultHttp2RemoteFlowControllerTest"]
  111a72eb_db91_694e_e2ed_66dfcaea4144 -->|defined in| f8fd7697_92d4_6455_4dd8_09a33ac81a6f
  2138bd63_dd75_adae_bf55_ec27bb49f749["size()"]
  111a72eb_db91_694e_e2ed_66dfcaea4144 -->|calls| 2138bd63_dd75_adae_bf55_ec27bb49f749
  abf1bc09_403f_110e_0b96_d73f451a8f8b["write()"]
  111a72eb_db91_694e_e2ed_66dfcaea4144 -->|calls| abf1bc09_403f_110e_0b96_d73f451a8f8b
  46be14d4_2ad4_2dfe_fa3e_2212c0d8e50e["error()"]
  111a72eb_db91_694e_e2ed_66dfcaea4144 -->|calls| 46be14d4_2ad4_2dfe_fa3e_2212c0d8e50e
  5af4576c_23ff_8e3b_df41_9d71757029eb["writeComplete()"]
  111a72eb_db91_694e_e2ed_66dfcaea4144 -->|calls| 5af4576c_23ff_8e3b_df41_9d71757029eb
  style 111a72eb_db91_694e_e2ed_66dfcaea4144 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowControllerTest.java lines 802–832

    @Test
    public void closeStreamInFlowControlledError() throws Exception {
        final Http2RemoteFlowController.FlowControlled flowControlled =
                mock(Http2RemoteFlowController.FlowControlled.class);
        final Http2Stream stream = stream(STREAM_A);
        when(flowControlled.size()).thenReturn(100);
        doThrow(new RuntimeException("write failed"))
            .when(flowControlled).write(any(ChannelHandlerContext.class), anyInt());
        doAnswer(new Answer<Void>() {
            @Override
            public Void answer(InvocationOnMock invocationOnMock) {
                stream.close();
                return null;
            }
        }).when(flowControlled).error(any(ChannelHandlerContext.class), any(Throwable.class));

        controller.addFlowControlled(stream, flowControlled);
        controller.writePendingBytes();

        verify(flowControlled).write(any(ChannelHandlerContext.class), anyInt());
        verify(flowControlled).error(any(ChannelHandlerContext.class), any(Throwable.class));
        verify(flowControlled, never()).writeComplete();
        verify(listener, times(1)).writabilityChanged(stream);
        verify(listener, never()).writabilityChanged(stream(STREAM_B));
        verify(listener, never()).writabilityChanged(stream(STREAM_C));
        verify(listener, never()).writabilityChanged(stream(STREAM_D));
        assertFalse(controller.isWritable(stream));
        assertTrue(controller.isWritable(stream(STREAM_B)));
        assertTrue(controller.isWritable(stream(STREAM_C)));
        assertTrue(controller.isWritable(stream(STREAM_D)));
    }

Domain

Subdomains

Frequently Asked Questions

What does closeStreamInFlowControlledError() do?
closeStreamInFlowControlledError() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowControllerTest.java.
Where is closeStreamInFlowControlledError() defined?
closeStreamInFlowControlledError() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2RemoteFlowControllerTest.java at line 802.
What does closeStreamInFlowControlledError() call?
closeStreamInFlowControlledError() calls 4 function(s): error, size, write, writeComplete.

Analyze Your Own Codebase

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

Try Supermodel Free