code: private void handleRequest(long requestId, Object request, HandlerHolder handler) {
      @SuppressWarnings("unchecked")
      CompletableFuture<Object> responseFuture = handler.handler.apply(request);
      if (responseFuture != null) {
        responseFuture.whenComplete((response, error) -> {
          ThreadContext context = ThreadContext.currentContext();
          if (context == null) {
            this.context.executor().execute(() -> {
              if (error == null) {
                handleRequestSuccess(requestId, response, this.context);
              } else {
                handleRequestFailure(requestId, error, this.context);
              }
            });
          } else {
            if (error == null) {
              handleRequestSuccess(requestId, response, context);
            } else {
              handleRequestFailure(requestId, error, context);
            }
          }
        });
      }
    }
docs: Handles a request.