class Eth2IncomingRequestHandler implements RpcRequestHandler {

  @Override
  public void complete(NodeId nodeId, RpcStream rpcStream) {
    try {
      Optional<Eth2Peer> peer = peerLookup.getConnectedPeer(nodeId);
      requestDecoder
          .complete()
          .ifPresent(
              request ->
                  handleRequest(peer, request, new RpcResponseCallback<>(rpcStream, rpcEncoder)));
      ;
    } catch (RpcException e) {
      new RpcResponseCallback<>(rpcStream, rpcEncoder).completeWithErrorResponse(e);
      LOG.debug("RPC Request stream closed prematurely", e);
    }
  }

  public  Eth2IncomingRequestHandler(
      final AsyncRunner asyncRunner,
      final Eth2RpcMethod<TRequest, TResponse> method,
      final PeerLookup peerLookup,
      final LocalMessageHandler<TRequest, TResponse> localMessageHandler);

}