Please note the sentence before the one you quoted: "This is thread-safe with respect to *Write* or *WritesDone* methods. It should not be called concurrently with other streaming APIs on the same stream." By "other streaming APIs," I meant "other than Write or Writes Done," but I understand that it can be confusing so we can move to rewrite that comment.
If you need to finish up with an error while there is a read outstanding, you should do cancel/AsyncNotify as you mentioned. Finish isn't meant to be done concurrently with either Read or Write operations. Regards, Vijay On Wed, Feb 22, 2017 at 8:24 PM Arpit Baldeva <[email protected]> wrote: > Thanks for the info. > > The documentation for grpc::ServerAsyncReaderWriter< W, R >::Read says ( > http://www.grpc.io/grpc/cpp/classgrpc_1_1_server_async_reader_writer.html#a2adbae40645434ad5f55823967998acc > ) - > > " It should not be called concurrently with other streaming APIs on the > same stream. " > > So if a streaming write operation is allowed concurrently, this doc should > be updated? > > And then on the same topic, if I have a read operation queued but > meanwhile the server decides to finish up (say an error/whatever), can I > queue up a Finish/FinishWithError call? Or is the correct usage there is to > call TryCancel on the server context with an AsyncNotifyWhenDone call? > > Thanks. > > > > On Wed, Feb 22, 2017 at 7:59 PM, Vijay Pai <[email protected]> wrote: > > You can have a simultaneous pending read and write operation on a stream > in the C++ async API, no problem. Ping-pong is not required for any gRPC > streaming operations. > > On Wed, Feb 22, 2017 at 4:45 PM Arpit Baldeva <[email protected]> wrote: > > Hi, > > For bi-directional streaming, can I have both pending read and write > operations at the same time (1 of each)? > > All the examples I found so far seem to do ping-pong behavior (1 read > followed by 1 write) but I don't recall reading any documentation that > mentions this constraint on protocol level. In other words, can I do > multiple reads followed by a single write (and vice versa)? And if that is > true, I'd like to be able to request both async read and write at the same > time. > > Thanks. > > -- > 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/a8324087-4dcf-45c3-bd99-ca187b4cb993%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/a8324087-4dcf-45c3-bd99-ca187b4cb993%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/CADEy0h3dyTFDWQekNaujkSszopjdZ0%2Bkc%3Dk15-z6y80eVtMmgQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
smime.p7s
Description: S/MIME Cryptographic Signature
