salesforce/reactive-grpc

Possible to have non-publisher for RPC method parameter?

deepak-auto opened this issue · 2 comments

Using the example in the README, can we have this method signature

ReactorGreeterGrpc.GreeterImplBase svc = new ReactorGreeterGrpc.GreeterImplBase() {
    @Override
    public Mono<HelloResponse> sayHello(HelloRequest request) {
        return greet("Hello", request);
    }
};

instead of

ReactorGreeterGrpc.GreeterImplBase svc = new ReactorGreeterGrpc.GreeterImplBase() {
    @Override
    public Mono<HelloResponse> sayHello(Mono<HelloRequest> request) {
        return request.map(protoRequest -> greet("Hello", protoRequest));
    }
};

?

This way, we can access the request object from anywhere in the method. It will prevent us from writing an extra map function as in the example above.

Duplicate of #78 (shouldn't be closed, btw :))

Have submitted #301 (better later then never, huh? 😄)