|
|
@ -64,7 +64,7 @@ class ClientAsyncStreamingInterface { |
|
|
|
/// earlier call to \a AsyncReaderInterface::Read that yielded a failed
|
|
|
|
/// earlier call to \a AsyncReaderInterface::Read that yielded a failed
|
|
|
|
/// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false').
|
|
|
|
/// result, e.g. cq->Next(&read_tag, &ok) filled in 'ok' with 'false').
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// This function will return when either:
|
|
|
|
/// The tag will be returned when either:
|
|
|
|
/// - all incoming messages have been read and the server has returned
|
|
|
|
/// - all incoming messages have been read and the server has returned
|
|
|
|
/// a status.
|
|
|
|
/// a status.
|
|
|
|
/// - the server has returned a non-OK status.
|
|
|
|
/// - the server has returned a non-OK status.
|
|
|
@ -114,6 +114,9 @@ class AsyncWriterInterface { |
|
|
|
/// queue BEFORE calling Write again.
|
|
|
|
/// queue BEFORE calling Write again.
|
|
|
|
/// This is thread-safe with respect to \a AsyncReaderInterface::Read
|
|
|
|
/// This is thread-safe with respect to \a AsyncReaderInterface::Read
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Write returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] tag The tag identifying the operation.
|
|
|
|
/// \param[in] tag The tag identifying the operation.
|
|
|
|
virtual void Write(const W& msg, void* tag) = 0; |
|
|
|
virtual void Write(const W& msg, void* tag) = 0; |
|
|
@ -127,6 +130,9 @@ class AsyncWriterInterface { |
|
|
|
/// WriteOptions \a options is used to set the write options of this message.
|
|
|
|
/// WriteOptions \a options is used to set the write options of this message.
|
|
|
|
/// This is thread-safe with respect to \a AsyncReaderInterface::Read
|
|
|
|
/// This is thread-safe with respect to \a AsyncReaderInterface::Read
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Write returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] tag The tag identifying the operation.
|
|
|
|
/// \param[in] tag The tag identifying the operation.
|
|
|
@ -144,6 +150,9 @@ class AsyncWriterInterface { |
|
|
|
/// the flow control window size. If \a msg size is larger than the window
|
|
|
|
/// the flow control window size. If \a msg size is larger than the window
|
|
|
|
/// size, it will be sent on wire without buffering.
|
|
|
|
/// size, it will be sent on wire without buffering.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Write returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] tag The tag identifying the operation.
|
|
|
|
/// \param[in] tag The tag identifying the operation.
|
|
|
@ -651,6 +660,9 @@ class ServerAsyncReaderInterface |
|
|
|
/// metadata (if not sent already), response message, and status, or if
|
|
|
|
/// metadata (if not sent already), response message, and status, or if
|
|
|
|
/// some failure occurred when trying to do so.
|
|
|
|
/// some failure occurred when trying to do so.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg or \a status, so it
|
|
|
|
|
|
|
|
/// is safe to to deallocate once Finish returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
/// \param[in] msg To be sent to the client as the response for this call.
|
|
|
|
/// \param[in] msg To be sent to the client as the response for this call.
|
|
|
@ -671,6 +683,9 @@ class ServerAsyncReaderInterface |
|
|
|
/// metadata (if not sent already), and status, or if some failure occurred
|
|
|
|
/// metadata (if not sent already), and status, or if some failure occurred
|
|
|
|
/// when trying to do so.
|
|
|
|
/// when trying to do so.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once FinishWithError returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
/// - Note: \a status must have a non-OK code.
|
|
|
|
/// - Note: \a status must have a non-OK code.
|
|
|
@ -718,6 +733,9 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { |
|
|
|
/// initial and trailing metadata.
|
|
|
|
/// initial and trailing metadata.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: \a msg is not sent if \a status has a non-OK code.
|
|
|
|
/// Note: \a msg is not sent if \a status has a non-OK code.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
|
|
|
|
|
|
|
|
/// is safe to to deallocate once Finish returns.
|
|
|
|
void Finish(const W& msg, const Status& status, void* tag) override { |
|
|
|
void Finish(const W& msg, const Status& status, void* tag) override { |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!ctx_->sent_initial_metadata_) { |
|
|
|
if (!ctx_->sent_initial_metadata_) { |
|
|
@ -744,6 +762,9 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { |
|
|
|
/// - also sends initial metadata if not alreay sent.
|
|
|
|
/// - also sends initial metadata if not alreay sent.
|
|
|
|
/// - uses the \a ServerContext associated with this call to send possible
|
|
|
|
/// - uses the \a ServerContext associated with this call to send possible
|
|
|
|
/// initial and trailing metadata.
|
|
|
|
/// initial and trailing metadata.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once FinishWithError returns.
|
|
|
|
void FinishWithError(const Status& status, void* tag) override { |
|
|
|
void FinishWithError(const Status& status, void* tag) override { |
|
|
|
GPR_CODEGEN_ASSERT(!status.ok()); |
|
|
|
GPR_CODEGEN_ASSERT(!status.ok()); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
@ -794,6 +815,9 @@ class ServerAsyncWriterInterface |
|
|
|
/// metadata (if not sent already), response message, and status, or if
|
|
|
|
/// metadata (if not sent already), response message, and status, or if
|
|
|
|
/// some failure occurred when trying to do so.
|
|
|
|
/// some failure occurred when trying to do so.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Finish returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
virtual void Finish(const Status& status, void* tag) = 0; |
|
|
|
virtual void Finish(const Status& status, void* tag) = 0; |
|
|
@ -805,6 +829,9 @@ class ServerAsyncWriterInterface |
|
|
|
/// WriteAndFinish is equivalent of performing WriteLast and Finish
|
|
|
|
/// WriteAndFinish is equivalent of performing WriteLast and Finish
|
|
|
|
/// in a single step.
|
|
|
|
/// in a single step.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
|
|
|
|
|
|
|
|
/// is safe to to deallocate once WriteAndFinish returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] status The Status that server returns to client.
|
|
|
|
/// \param[in] status The Status that server returns to client.
|
|
|
@ -868,6 +895,9 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { |
|
|
|
/// for sending trailing (and initial) metadata to the client.
|
|
|
|
/// for sending trailing (and initial) metadata to the client.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: \a status must have an OK code.
|
|
|
|
/// Note: \a status must have an OK code.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
|
|
|
|
|
|
|
|
/// is safe to to deallocate once WriteAndFinish returns.
|
|
|
|
void WriteAndFinish(const W& msg, WriteOptions options, const Status& status, |
|
|
|
void WriteAndFinish(const W& msg, WriteOptions options, const Status& status, |
|
|
|
void* tag) override { |
|
|
|
void* tag) override { |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
@ -886,6 +916,9 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { |
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: there are no restrictions are the code of
|
|
|
|
/// Note: there are no restrictions are the code of
|
|
|
|
/// \a status,it may be non-OK
|
|
|
|
/// \a status,it may be non-OK
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Finish returns.
|
|
|
|
void Finish(const Status& status, void* tag) override { |
|
|
|
void Finish(const Status& status, void* tag) override { |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
EnsureInitialMetadataSent(&finish_ops_); |
|
|
|
EnsureInitialMetadataSent(&finish_ops_); |
|
|
@ -945,6 +978,9 @@ class ServerAsyncReaderWriterInterface |
|
|
|
/// metadata (if not sent already), response message, and status, or if some
|
|
|
|
/// metadata (if not sent already), response message, and status, or if some
|
|
|
|
/// failure occurred when trying to do so.
|
|
|
|
/// failure occurred when trying to do so.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Finish returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
/// \param[in] status To be sent to the client as the result of this call.
|
|
|
|
virtual void Finish(const Status& status, void* tag) = 0; |
|
|
|
virtual void Finish(const Status& status, void* tag) = 0; |
|
|
@ -956,6 +992,9 @@ class ServerAsyncReaderWriterInterface |
|
|
|
/// WriteAndFinish is equivalent of performing WriteLast and Finish in a
|
|
|
|
/// WriteAndFinish is equivalent of performing WriteLast and Finish in a
|
|
|
|
/// single step.
|
|
|
|
/// single step.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
|
|
|
|
|
|
|
|
/// is safe to to deallocate once WriteAndFinish returns.
|
|
|
|
|
|
|
|
///
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] msg The message to be written.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] options The WriteOptions to be used to write this message.
|
|
|
|
/// \param[in] status The Status that server returns to client.
|
|
|
|
/// \param[in] status The Status that server returns to client.
|
|
|
@ -1027,6 +1066,9 @@ class ServerAsyncReaderWriter final |
|
|
|
/// for sending trailing (and initial) metadata to the client.
|
|
|
|
/// for sending trailing (and initial) metadata to the client.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: \a status must have an OK code.
|
|
|
|
/// Note: \a status must have an OK code.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
|
|
|
|
|
|
|
|
/// is safe to to deallocate once WriteAndFinish returns.
|
|
|
|
void WriteAndFinish(const W& msg, WriteOptions options, const Status& status, |
|
|
|
void WriteAndFinish(const W& msg, WriteOptions options, const Status& status, |
|
|
|
void* tag) override { |
|
|
|
void* tag) override { |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
@ -1045,6 +1087,9 @@ class ServerAsyncReaderWriter final |
|
|
|
///
|
|
|
|
///
|
|
|
|
/// Note: there are no restrictions are the code of \a status,
|
|
|
|
/// Note: there are no restrictions are the code of \a status,
|
|
|
|
/// it may be non-OK
|
|
|
|
/// it may be non-OK
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
|
|
|
|
/// to deallocate once Finish returns.
|
|
|
|
void Finish(const Status& status, void* tag) override { |
|
|
|
void Finish(const Status& status, void* tag) override { |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
EnsureInitialMetadataSent(&finish_ops_); |
|
|
|
EnsureInitialMetadataSent(&finish_ops_); |
|
|
|