aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/support/async_stream.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-09-03 11:36:51 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-09-03 11:36:51 -0700
commit627758d0ccea12ee9bf40cd13064a4faf1a5fba9 (patch)
treeb94816d80f0f736112103437c08cfddacb015d9e /include/grpc++/support/async_stream.h
parent4326f739b6db5208f9bd685415acfa7db46a123a (diff)
parentbda7b617c9a7df47a5f7477d74e1bb982df95410 (diff)
Merge branch 'release-0_11' of github.com:grpc/grpc into fix-teh-tests
Diffstat (limited to 'include/grpc++/support/async_stream.h')
-rw-r--r--include/grpc++/support/async_stream.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/include/grpc++/support/async_stream.h b/include/grpc++/support/async_stream.h
index 4c12fda12f..b4dae30cd5 100644
--- a/include/grpc++/support/async_stream.h
+++ b/include/grpc++/support/async_stream.h
@@ -45,32 +45,48 @@
namespace grpc {
-// Async interfaces
-// Common interface for all client side streaming.
+/// Common interface for all client side asynchronous streaming.
class ClientAsyncStreamingInterface {
public:
virtual ~ClientAsyncStreamingInterface() {}
+ /// Request notification of the reading of the initial metadata. Completion
+ /// will be notified by \a tag on the associated completion queue.
+ ///
+ /// \param[in] tag Tag identifying this request.
virtual void ReadInitialMetadata(void* tag) = 0;
+ /// Request notification completion.
+ ///
+ /// \param[out] status To be updated with the operation status.
+ /// \param[in] tag Tag identifying this request.
virtual void Finish(Status* status, void* tag) = 0;
};
-// An interface that yields a sequence of R messages.
+/// An interface that yields a sequence of messages of type \a R.
template <class R>
class AsyncReaderInterface {
public:
virtual ~AsyncReaderInterface() {}
+ /// Read a message of type \a R into \a msg. Completion will be notified by \a
+ /// tag on the associated completion queue.
+ ///
+ /// \param[out] msg Where to eventually store the read message.
+ /// \param[in] tag The tag identifying the operation.
virtual void Read(R* msg, void* tag) = 0;
};
-// An interface that can be fed a sequence of W messages.
+/// An interface that can be fed a sequence of messages of type \a W.
template <class W>
class AsyncWriterInterface {
public:
virtual ~AsyncWriterInterface() {}
+ /// Request the writing of \a msg with identifying tag \a tag.
+ ///
+ /// \param[in] msg The message to be written.
+ /// \param[in] tag The tag identifying the operation.
virtual void Write(const W& msg, void* tag) = 0;
};
@@ -81,7 +97,7 @@ class ClientAsyncReaderInterface : public ClientAsyncStreamingInterface,
template <class R>
class ClientAsyncReader GRPC_FINAL : public ClientAsyncReaderInterface<R> {
public:
- // Create a stream and write the first request out.
+ /// Create a stream and write the first request out.
template <class W>
ClientAsyncReader(Channel* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context,
@@ -131,10 +147,14 @@ class ClientAsyncReader GRPC_FINAL : public ClientAsyncReaderInterface<R> {
CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_;
};
+/// Common interface for client side asynchronous writing.
template <class W>
class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface,
public AsyncWriterInterface<W> {
public:
+ /// Signal the client is done with the writes.
+ ///
+ /// \param[in] tag The tag identifying the operation.
virtual void WritesDone(void* tag) = 0;
};
@@ -194,12 +214,15 @@ class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
CallOpClientRecvStatus> finish_ops_;
};
-// Client-side interface for bi-directional streaming.
+/// Client-side interface for asynchronous bi-directional streaming.
template <class W, class R>
class ClientAsyncReaderWriterInterface : public ClientAsyncStreamingInterface,
public AsyncWriterInterface<W>,
public AsyncReaderInterface<R> {
public:
+ /// Signal the client is done with the writes.
+ ///
+ /// \param[in] tag The tag identifying the operation.
virtual void WritesDone(void* tag) = 0;
};
@@ -373,7 +396,7 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
};
-// Server-side interface for bi-directional streaming.
+/// Server-side interface for asynchronous bi-directional streaming.
template <class W, class R>
class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
public AsyncWriterInterface<W>,