@Override
    public void handleRequest(final RpcContext rpcCtx, final IncrementAndGetRequest request) {
        final CounterClosure closure = new CounterClosure() {
            @Override
            public void run(Status status) {
                rpcCtx.sendResponse(getValueResponse());
            }
        };

        this.counterService.incrementAndGet(request.getDelta(), closure);
    }
IncrementAndGetRequest processor.

@author boyan (boyan@alibaba-inc.com)

2018-Apr-09 5:43:57 PM
jraft-example/src/main/java/com/alipay/sofa/jraft/example/counter/rpc/IncrementAndGetRequestProcessor.java