Threaded async server for grpc

34 views
Skip to first unread message

kr8...@gmail.com

unread,
Jun 21, 2019, 3:14:57 AM6/21/19
to grpc.io
Hi there,

I want to use my service as threaded server for handling each request concurrently.

But I only see the examples of threaded server of which service use just one rpc methods.

I could see the way how to handle the requests with Queue, but both examples use a single type of request and reply.
But how can I handle the multiple types of rpc requests in service and relevant responses like that way?

Is there any example or recommended way to use async server?
I'm now using the sync server as the https://github.com/grpc/grpc/blob/v1.21.0/examples/cpp/helloworld/greeter_server.cc example like below.

ServerBuilder builder;
builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
builder.RegisterService(&service);
std::unique_ptr<Server> server(builder.BuildAndStart());

I'm looking forward to your help.
Thanks a lot in advance! :)

kr8...@gmail.com

unread,
Jun 21, 2019, 3:30:54 AM6/21/19
to grpc.io
Or is there any way to use sync server not to blocking each insert request? as the above, server insert throughput doesn't go well with #thread when I use apache thrift as the same manner

2019년 6월 21일 금요일 오후 4시 14분 57초 UTC+9, kr8...@gmail.com 님의 말:

kr8...@gmail.com

unread,
Jun 21, 2019, 3:32:13 AM6/21/19
to grpc.io
I just fix the typo. 
Or is there any way to use sync server not to blocking each insert request? as the above, server insert throughput doesn't go well with #thread. But when I use apache thrift as the same manner it does go well with #thread.

2019년 6월 21일 금요일 오후 4시 30분 54초 UTC+9, kr8...@gmail.com 님의 말:
Reply all
Reply to author
Forward
0 new messages