Completion queue and async IO

445 views
Skip to first unread message

Andrey Myznikov

unread,
Aug 13, 2016, 12:07:11 PM8/13/16
to grpc.io
Hello,
   I would like to use gRPC asynchronous API on server side to serve many client's with no creating toooo many threads.
My asynchronous request handler on server side issues  asynchronous request to some database (assume I use libpq just for example), and I would like to NOT block here, but just call cq->Next() to serve next clients.

Clarify me please - is there a way to 'integrate' grpc completion queue with "non-grpc" events (non-blocking socket IO, eventfd, etc) ?
For example - something like to pass a non-blocking socket and some tag to completion queue and ask it to wake up when this socket will 'signalled'  (pollin, pollout, etc) ?

What is the best way to intergrate grpc completion queue with "non-grpc" events ?

Thanks!

Nicolas Noble

unread,
Aug 13, 2016, 7:54:37 PM8/13/16
to Andrey Myznikov, grpc.io
Unfortunately, while it's somewhat possible to do that at the moment with the current code base, we don't have a clear path and documentation about how to do so. We definitely understand the and need for such a scenario, and we'll eventually clean this, document it and put some examples, but at the moment, we focused our efforts on making the general case as optimal as possible in terms of speed, which means that the polling API changed significantly over time, making this other goal a difficult moving target.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/21b1515e-11a4-4d56-8d4f-3bc4f916252f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages