aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/codegen/async_stream.h
diff options
context:
space:
mode:
authorGravatar vjpai <vpai@google.com>2016-06-17 00:27:00 -0700
committerGravatar vjpai <vpai@google.com>2016-06-17 00:27:00 -0700
commitb9df2760ed15930429305f01407914db106510d5 (patch)
tree44c94241c47e0c051333bf718763b19146cf4ccf /include/grpc++/impl/codegen/async_stream.h
parentfa9b7c1bc6488be17d18007f45c57dac39ea5b79 (diff)
Add proper documentation of ordering and thread-safety for
streaming (sync and async) APIs
Diffstat (limited to 'include/grpc++/impl/codegen/async_stream.h')
-rw-r--r--include/grpc++/impl/codegen/async_stream.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h
index 0606441549..c74737ce5f 100644
--- a/include/grpc++/impl/codegen/async_stream.h
+++ b/include/grpc++/impl/codegen/async_stream.h
@@ -52,11 +52,14 @@ class ClientAsyncStreamingInterface {
/// Request notification of the reading of the initial metadata. Completion
/// will be notified by \a tag on the associated completion queue.
+ /// This call is optional, but if it is used, it cannot be used concurrently
+ /// with Read
///
/// \param[in] tag Tag identifying this request.
virtual void ReadInitialMetadata(void* tag) = 0;
- /// Request notification completion.
+ /// Indicate that the stream is to be finished and request notification
+ /// Should not be used concurrently with other operations
///
/// \param[out] status To be updated with the operation status.
/// \param[in] tag Tag identifying this request.
@@ -71,6 +74,8 @@ class AsyncReaderInterface {
/// Read a message of type \a R into \a msg. Completion will be notified by \a
/// tag on the associated completion queue.
+ /// This is thread-safe with respect to other streaming APIs except for Finish
+ /// on the same stream.
///
/// \param[out] msg Where to eventually store the read message.
/// \param[in] tag The tag identifying the operation.
@@ -88,6 +93,7 @@ class AsyncWriterInterface {
/// Only one write may be outstanding at any given time. This means that
/// after calling Write, one must wait to receive \a tag from the completion
/// queue BEFORE calling Write again.
+ /// This is thread-safe with respect to Read
///
/// \param[in] msg The message to be written.
/// \param[in] tag The tag identifying the operation.
@@ -158,6 +164,7 @@ class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface,
public AsyncWriterInterface<W> {
public:
/// Signal the client is done with the writes.
+ /// Thread-safe with respect to Read
///
/// \param[in] tag The tag identifying the operation.
virtual void WritesDone(void* tag) = 0;
@@ -229,6 +236,7 @@ class ClientAsyncReaderWriterInterface : public ClientAsyncStreamingInterface,
public AsyncReaderInterface<R> {
public:
/// Signal the client is done with the writes.
+ /// Thread-safe with respect to Read
///
/// \param[in] tag The tag identifying the operation.
virtual void WritesDone(void* tag) = 0;