Hi Sree and Sumant, So, it's a little subtle but there is API to inject events into the C++ completion queue: just set a grpc::Alarm with an immediate deadline. That will post the tag that you specify right away.
- Vijay On Wed, Feb 6, 2019, 9:40 PM <[email protected]> wrote: > > Hi Sumant, > Unfortunately, the answer to the previous email thread you mentioned (i.e > https://groups.google.com/forum/#!topic/grpc-io/NrrPOKEZbAU ) is still > relevant. > > There is currently no way to do that although in theory it should be > possible to (by exposing the low-level/internal completion queue APIs i.e > grpc_cq_begin_op() > <https://github.com/grpc/grpc/blob/v1.18.0/src/core/lib/surface/completion_queue.h#L74> > and grpc_cq_end_op() > <https://github.com/grpc/grpc/blob/v1.18.0/src/core/lib/surface/completion_queue.h#L78> > APIs > via C++ wrappers). There isn't a way to signal a condition variable either > > If possible, do create a ticket so that the team can triage it. > > -Sree > > > On Wednesday, February 6, 2019 at 5:00:50 PM UTC-8, [email protected] > wrote: >> >> Hi folks, >> >> I'm wondering if there's a way in grpc::CompletionQueue to insert events >> dequeued from a non-grpc job queue? >> >> I've two queues in my server: one grpc::CompleteQueue and another >> unrelated internal queue. Currently, I'm polling both queues in the same >> thread for availability of an event. It sort of busy loops. I would like to >> have one stop for all event multiplexing. If there is a way to insert an >> event into a grpc_completion_queue (with some tag) and retrieve it back out >> from cq_.AsynNext, that would do the trick. Effectively, use >> gprc_completion_queue as a pipe. Is this possible? >> >> A very similar question was discussed here: >> https://groups.google.com/forum/#!topic/grpc-io/NrrPOKEZbAU Looks like >> back in 2016 no such way existed. >> >> Alternatively, is there a way to notify a condition_variable upon >> availability of an event in the grpc_completion_queue? The polling thread >> would block simply block on the condition_variable and will subsequently >> call cq.AsyncNext with zero timeout. >> >> Regards, >> Sumant >> > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/grpc-io. > To view this discussion on the web visit > https://groups.google.com/d/msgid/grpc-io/d38eac53-c71e-4d00-b3ee-300719ead390%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/d38eac53-c71e-4d00-b3ee-300719ead390%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CADEy0h1M8Py2U%3D5j-oQBa0N4zpvKVm0orzSuHD6GqBtyW7avbA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
smime.p7s
Description: S/MIME Cryptographic Signature
