@Test public void processAllExpectedChunks() throws Exception { sendInitialPayload(); verify(rpcStream).closeWriteStream(); for (int i = 0; i < maxChunks; i++) { deliverChunk(i); assertThat(finishedProcessingFuture).isNotDone(); } complete(); asyncRequestRunner.waitForExactly(maxChunks - 1); assertThat(finishedProcessingFuture).isNotDone(); asyncRequestRunner.waitForExactly(1); timeoutRunner.executeUntilDone(); Waiter.waitFor(() -> assertThat(finishedProcessingFuture).isDone()); assertThat(finishedProcessingFuture).isCompletedWithValue(null); verify(rpcStream).close(); assertThat(blocks.size()).isEqualTo(3); }
@Override public void complete(NodeId nodeId, RpcStream rpcStream) { try { responseDecoder.complete(); completeRequest(rpcStream); } catch (RpcException e) { cancelRequest(rpcStream, e); } }
Eth2OutgoingRequestHandler implements RpcRequestHandler { @Override public void complete(NodeId nodeId, RpcStream rpcStream) { try { responseDecoder.complete(); completeRequest(rpcStream); } catch (RpcException e) { cancelRequest(rpcStream, e); } } }
Eth2OutgoingRequestHandler implements RpcRequestHandler { @Override public void complete(NodeId nodeId, RpcStream rpcStream) { try { responseDecoder.complete(); completeRequest(rpcStream); } catch (RpcException e) { cancelRequest(rpcStream, e); } } Eth2OutgoingRequestHandler(
      final AsyncRunner asyncRunner,
      final AsyncRunner timeoutRunner,
      final Eth2RpcMethod<TRequest, TResponse> method,
      final int maximumResponseChunks); }
Eth2OutgoingRequestHandler implements RpcRequestHandler { @Override public void complete(NodeId nodeId, RpcStream rpcStream) { try { responseDecoder.complete(); completeRequest(rpcStream); } catch (RpcException e) { cancelRequest(rpcStream, e); } } Eth2OutgoingRequestHandler(
      final AsyncRunner asyncRunner,
      final AsyncRunner timeoutRunner,
      final Eth2RpcMethod<TRequest, TResponse> method,
      final int maximumResponseChunks); void handleInitialPayloadSent(final RpcStream stream); @Override void active(NodeId nodeId, RpcStream rpcStream); @Override void processData(final NodeId nodeId, final RpcStream rpcStream, final ByteBuf data); @Override void complete(NodeId nodeId, RpcStream rpcStream); ResponseStreamImpl<TResponse> getResponseStream(); @Override String toString(); }
Eth2OutgoingRequestHandler implements RpcRequestHandler { @Override public void complete(NodeId nodeId, RpcStream rpcStream) { try { responseDecoder.complete(); completeRequest(rpcStream); } catch (RpcException e) { cancelRequest(rpcStream, e); } } Eth2OutgoingRequestHandler(
      final AsyncRunner asyncRunner,
      final AsyncRunner timeoutRunner,
      final Eth2RpcMethod<TRequest, TResponse> method,
      final int maximumResponseChunks); void handleInitialPayloadSent(final RpcStream stream); @Override void active(NodeId nodeId, RpcStream rpcStream); @Override void processData(final NodeId nodeId, final RpcStream rpcStream, final ByteBuf data); @Override void complete(NodeId nodeId, RpcStream rpcStream); ResponseStreamImpl<TResponse> getResponseStream(); @Override String toString();  }