Lately, I 'm studying to build the gRPC client-server interaction.
I wrote a gRPC service :
service SearchService {
rpc Find (SearchReq) returns (SearchRes);
}
and then I should invoke it on the client side using stub(another java-application).
whats the difference between this two types of stubs??
SearchServiceGrpc.SearchServiceFutureStub futureStub = SearchServiceGrpc.newFutureStub(channel);
SearchServiceGrpc.SearchServiceBlockingStub blockingStub = SearchServiceGrpc.newBlockingStub(channel);
blockingStub.find(request);
- for blocking
futureStub.find(request).get();
- for future
I understand how works Futures in java, but I don't understand what happens inside gRPC and what type of stubs invocation is more productive
I find no information on google about it.
Thanks!