|
|
@ -19,7 +19,7 @@ |
|
|
|
#ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H |
|
|
|
#ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H |
|
|
|
#define GRPCPP_SUPPORT_ASYNC_STREAM_H |
|
|
|
#define GRPCPP_SUPPORT_ASYNC_STREAM_H |
|
|
|
|
|
|
|
|
|
|
|
#include "absl/log/check.h" |
|
|
|
#include "absl/log/absl_check.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <grpc/grpc.h> |
|
|
|
#include <grpc/grpc.h> |
|
|
|
#include <grpc/support/log.h> |
|
|
|
#include <grpc/support/log.h> |
|
|
@ -202,7 +202,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
public: |
|
|
|
public: |
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
CHECK_EQ(size, sizeof(ClientAsyncReader)); |
|
|
|
ABSL_CHECK_EQ(size, sizeof(ClientAsyncReader)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
@ -210,10 +210,10 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
static void operator delete(void*, void*) { CHECK(false); } |
|
|
|
static void operator delete(void*, void*) { ABSL_CHECK(false); } |
|
|
|
|
|
|
|
|
|
|
|
void StartCall(void* tag) override { |
|
|
|
void StartCall(void* tag) override { |
|
|
|
CHECK(!started_); |
|
|
|
ABSL_CHECK(!started_); |
|
|
|
started_ = true; |
|
|
|
started_ = true; |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} |
|
|
|
} |
|
|
@ -227,8 +227,8 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
/// calling code can access the received metadata through the
|
|
|
|
/// calling code can access the received metadata through the
|
|
|
|
/// \a ClientContext.
|
|
|
|
/// \a ClientContext.
|
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
CHECK(!context_->initial_metadata_received_); |
|
|
|
ABSL_CHECK(!context_->initial_metadata_received_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.RecvInitialMetadata(context_); |
|
|
|
meta_ops_.RecvInitialMetadata(context_); |
|
|
@ -236,7 +236,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
@ -251,7 +251,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// possible initial and trailing metadata received from the server.
|
|
|
|
/// possible initial and trailing metadata received from the server.
|
|
|
|
void Finish(grpc::Status* status, void* tag) override { |
|
|
|
void Finish(grpc::Status* status, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
@ -267,12 +267,12 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { |
|
|
|
const W& request, bool start, void* tag) |
|
|
|
const W& request, bool start, void* tag) |
|
|
|
: context_(context), call_(call), started_(start) { |
|
|
|
: context_(context), call_(call), started_(start) { |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(init_ops_.SendMessage(request).ok()); |
|
|
|
ABSL_CHECK(init_ops_.SendMessage(request).ok()); |
|
|
|
init_ops_.ClientSendClose(); |
|
|
|
init_ops_.ClientSendClose(); |
|
|
|
if (start) { |
|
|
|
if (start) { |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
CHECK(tag == nullptr); |
|
|
|
ABSL_CHECK(tag == nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -350,7 +350,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
public: |
|
|
|
public: |
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
CHECK_EQ(size, sizeof(ClientAsyncWriter)); |
|
|
|
ABSL_CHECK_EQ(size, sizeof(ClientAsyncWriter)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
@ -358,10 +358,10 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
static void operator delete(void*, void*) { CHECK(false); } |
|
|
|
static void operator delete(void*, void*) { ABSL_CHECK(false); } |
|
|
|
|
|
|
|
|
|
|
|
void StartCall(void* tag) override { |
|
|
|
void StartCall(void* tag) override { |
|
|
|
CHECK(!started_); |
|
|
|
ABSL_CHECK(!started_); |
|
|
|
started_ = true; |
|
|
|
started_ = true; |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} |
|
|
|
} |
|
|
@ -374,8 +374,8 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
/// associated with this call is updated, and the calling code can access
|
|
|
|
/// associated with this call is updated, and the calling code can access
|
|
|
|
/// the received metadata through the \a ClientContext.
|
|
|
|
/// the received metadata through the \a ClientContext.
|
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
CHECK(!context_->initial_metadata_received_); |
|
|
|
ABSL_CHECK(!context_->initial_metadata_received_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.RecvInitialMetadata(context_); |
|
|
|
meta_ops_.RecvInitialMetadata(context_); |
|
|
@ -383,27 +383,27 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, grpc::WriteOptions options, void* tag) override { |
|
|
|
void Write(const W& msg, grpc::WriteOptions options, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
if (options.is_last_message()) { |
|
|
|
if (options.is_last_message()) { |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
} |
|
|
|
} |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WritesDone(void* tag) override { |
|
|
|
void WritesDone(void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
@ -417,7 +417,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
/// - attempts to fill in the \a response parameter passed to this class's
|
|
|
|
/// - attempts to fill in the \a response parameter passed to this class's
|
|
|
|
/// constructor with the server's response message.
|
|
|
|
/// constructor with the server's response message.
|
|
|
|
void Finish(grpc::Status* status, void* tag) override { |
|
|
|
void Finish(grpc::Status* status, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
@ -437,7 +437,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { |
|
|
|
if (start) { |
|
|
|
if (start) { |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
CHECK(tag == nullptr); |
|
|
|
ABSL_CHECK(tag == nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -517,7 +517,7 @@ class ClientAsyncReaderWriter final |
|
|
|
public: |
|
|
|
public: |
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
// always allocated against a call arena, no memory free required
|
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
static void operator delete(void* /*ptr*/, std::size_t size) { |
|
|
|
CHECK_EQ(size, sizeof(ClientAsyncReaderWriter)); |
|
|
|
ABSL_CHECK_EQ(size, sizeof(ClientAsyncReaderWriter)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
|
// This operator should never be called as the memory should be freed as part
|
|
|
@ -525,10 +525,10 @@ class ClientAsyncReaderWriter final |
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// delete to the operator new so that some compilers will not complain (see
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
// there are no tests catching the compiler warning.
|
|
|
|
static void operator delete(void*, void*) { CHECK(false); } |
|
|
|
static void operator delete(void*, void*) { ABSL_CHECK(false); } |
|
|
|
|
|
|
|
|
|
|
|
void StartCall(void* tag) override { |
|
|
|
void StartCall(void* tag) override { |
|
|
|
CHECK(!started_); |
|
|
|
ABSL_CHECK(!started_); |
|
|
|
started_ = true; |
|
|
|
started_ = true; |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} |
|
|
|
} |
|
|
@ -541,8 +541,8 @@ class ClientAsyncReaderWriter final |
|
|
|
/// is updated with it, and then the receiving initial metadata can
|
|
|
|
/// is updated with it, and then the receiving initial metadata can
|
|
|
|
/// be accessed through this \a ClientContext.
|
|
|
|
/// be accessed through this \a ClientContext.
|
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
void ReadInitialMetadata(void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
CHECK(!context_->initial_metadata_received_); |
|
|
|
ABSL_CHECK(!context_->initial_metadata_received_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.RecvInitialMetadata(context_); |
|
|
|
meta_ops_.RecvInitialMetadata(context_); |
|
|
@ -550,7 +550,7 @@ class ClientAsyncReaderWriter final |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
void Read(R* msg, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
read_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
|
read_ops_.RecvInitialMetadata(context_); |
|
|
@ -560,27 +560,27 @@ class ClientAsyncReaderWriter final |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
void Write(const W& msg, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Write(const W& msg, grpc::WriteOptions options, void* tag) override { |
|
|
|
void Write(const W& msg, grpc::WriteOptions options, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
if (options.is_last_message()) { |
|
|
|
if (options.is_last_message()) { |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
} |
|
|
|
} |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WritesDone(void* tag) override { |
|
|
|
void WritesDone(void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
write_ops_.ClientSendClose(); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
@ -591,7 +591,7 @@ class ClientAsyncReaderWriter final |
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// - the \a ClientContext associated with this call is updated with
|
|
|
|
/// possible initial and trailing metadata sent from the server.
|
|
|
|
/// possible initial and trailing metadata sent from the server.
|
|
|
|
void Finish(grpc::Status* status, void* tag) override { |
|
|
|
void Finish(grpc::Status* status, void* tag) override { |
|
|
|
CHECK(started_); |
|
|
|
ABSL_CHECK(started_); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
if (!context_->initial_metadata_received_) { |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
|
finish_ops_.RecvInitialMetadata(context_); |
|
|
@ -608,7 +608,7 @@ class ClientAsyncReaderWriter final |
|
|
|
if (start) { |
|
|
|
if (start) { |
|
|
|
StartCallInternal(tag); |
|
|
|
StartCallInternal(tag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
CHECK(tag == nullptr); |
|
|
|
ABSL_CHECK(tag == nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -708,7 +708,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { |
|
|
|
/// - The initial metadata that will be sent to the client from this op will
|
|
|
|
/// - The initial metadata that will be sent to the client from this op will
|
|
|
|
/// be taken from the \a ServerContext associated with the call.
|
|
|
|
/// be taken from the \a ServerContext associated with the call.
|
|
|
|
void SendInitialMetadata(void* tag) override { |
|
|
|
void SendInitialMetadata(void* tag) override { |
|
|
|
CHECK(!ctx_->sent_initial_metadata_); |
|
|
|
ABSL_CHECK(!ctx_->sent_initial_metadata_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
|
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
@ -767,7 +767,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { |
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
|
|
|
|
/// to deallocate once FinishWithError returns.
|
|
|
|
/// to deallocate once FinishWithError returns.
|
|
|
|
void FinishWithError(const grpc::Status& status, void* tag) override { |
|
|
|
void FinishWithError(const grpc::Status& status, void* tag) override { |
|
|
|
CHECK(!status.ok()); |
|
|
|
ABSL_CHECK(!status.ok()); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
finish_ops_.set_output_tag(tag); |
|
|
|
if (!ctx_->sent_initial_metadata_) { |
|
|
|
if (!ctx_->sent_initial_metadata_) { |
|
|
|
finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
|
finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
@ -857,7 +857,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { |
|
|
|
///
|
|
|
|
///
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
void SendInitialMetadata(void* tag) override { |
|
|
|
void SendInitialMetadata(void* tag) override { |
|
|
|
CHECK(!ctx_->sent_initial_metadata_); |
|
|
|
ABSL_CHECK(!ctx_->sent_initial_metadata_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
|
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
@ -873,7 +873,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -885,7 +885,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { |
|
|
|
|
|
|
|
|
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -904,7 +904,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
|
CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); |
|
|
|
write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
@ -1023,7 +1023,7 @@ class ServerAsyncReaderWriter final |
|
|
|
///
|
|
|
|
///
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
/// \param[in] tag Tag identifying this request.
|
|
|
|
void SendInitialMetadata(void* tag) override { |
|
|
|
void SendInitialMetadata(void* tag) override { |
|
|
|
CHECK(!ctx_->sent_initial_metadata_); |
|
|
|
ABSL_CHECK(!ctx_->sent_initial_metadata_); |
|
|
|
|
|
|
|
|
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.set_output_tag(tag); |
|
|
|
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
|
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_, |
|
|
@ -1045,7 +1045,7 @@ class ServerAsyncReaderWriter final |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
// TODO(ctiller): don't assert
|
|
|
|
CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1055,7 +1055,7 @@ class ServerAsyncReaderWriter final |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
|
} |
|
|
|
} |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1075,7 +1075,7 @@ class ServerAsyncReaderWriter final |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
write_ops_.set_output_tag(tag); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
EnsureInitialMetadataSent(&write_ops_); |
|
|
|
options.set_buffer_hint(); |
|
|
|
options.set_buffer_hint(); |
|
|
|
CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok()); |
|
|
|
write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); |
|
|
|
write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
call_.PerformOps(&write_ops_); |
|
|
|
} |
|
|
|
} |
|
|
|