Multithread Websockets to increass throughput (#231)

Vertx by default orders all calls to executeBlocking in an ordered
fashion.  As a side effect all requests are single threaded, even across
multiple clients. Because JSON-RPC has request identifiers it is not
needed to thread responses as they can be answered out of order.  This
also allows multiple threads to handle requests, increasing throughput.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/238/head
Danno Ferrin 5 years ago committed by Lucas Saldanha
parent 86abac84c0
commit d643ad506e
  1. 1
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketRequestHandler.java

@ -88,6 +88,7 @@ public class WebSocketRequestHandler {
future.complete(new JsonRpcErrorResponse(request.getId(), JsonRpcError.INTERNAL_ERROR));
}
},
false,
result -> {
if (result.succeeded()) {
replyToClient(id, Json.encodeToBuffer(result.result()));

Loading…
Cancel
Save