GRPC C++  1.30.0
async_stream_impl.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_IMPL_H
19 #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_IMPL_H
20 
27 
28 namespace grpc_impl {
29 
30 namespace internal {
33  public:
35 
39  virtual void StartCall(void* tag) = 0;
40 
47  virtual void ReadInitialMetadata(void* tag) = 0;
48 
76  virtual void Finish(::grpc::Status* status, void* tag) = 0;
77 };
78 
80 template <class R>
82  public:
83  virtual ~AsyncReaderInterface() {}
84 
98  virtual void Read(R* msg, void* tag) = 0;
99 };
100 
102 template <class W>
104  public:
106 
119  virtual void Write(const W& msg, void* tag) = 0;
120 
136  virtual void Write(const W& msg, ::grpc::WriteOptions options, void* tag) = 0;
137 
156  void WriteLast(const W& msg, ::grpc::WriteOptions options, void* tag) {
157  Write(msg, options.set_last_message(), tag);
158  }
159 };
160 
161 } // namespace internal
162 
163 template <class R>
166  public internal::AsyncReaderInterface<R> {};
167 
168 namespace internal {
169 template <class R>
171  public:
179  template <class W>
182  const ::grpc::internal::RpcMethod& method,
183  ::grpc_impl::ClientContext* context,
184  const W& request, bool start, void* tag) {
185  ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
187  call.call(), sizeof(ClientAsyncReader<R>)))
188  ClientAsyncReader<R>(call, context, request, start, tag);
189  }
190 };
191 } // namespace internal
192 
196 template <class R>
198  public:
199  // always allocated against a call arena, no memory free required
200  static void operator delete(void* /*ptr*/, std::size_t size) {
201  GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncReader));
202  }
203 
204  // This operator should never be called as the memory should be freed as part
205  // of the arena destruction. It only exists to provide a matching operator
206  // delete to the operator new so that some compilers will not complain (see
207  // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
208  // there are no tests catching the compiler warning.
209  static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); }
210 
211  void StartCall(void* tag) override {
212  GPR_CODEGEN_ASSERT(!started_);
213  started_ = true;
214  StartCallInternal(tag);
215  }
216 
225  void ReadInitialMetadata(void* tag) override {
226  GPR_CODEGEN_ASSERT(started_);
227  GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
228 
229  meta_ops_.set_output_tag(tag);
230  meta_ops_.RecvInitialMetadata(context_);
231  call_.PerformOps(&meta_ops_);
232  }
233 
234  void Read(R* msg, void* tag) override {
235  GPR_CODEGEN_ASSERT(started_);
236  read_ops_.set_output_tag(tag);
237  if (!context_->initial_metadata_received_) {
238  read_ops_.RecvInitialMetadata(context_);
239  }
240  read_ops_.RecvMessage(msg);
241  call_.PerformOps(&read_ops_);
242  }
243 
249  void Finish(::grpc::Status* status, void* tag) override {
250  GPR_CODEGEN_ASSERT(started_);
251  finish_ops_.set_output_tag(tag);
252  if (!context_->initial_metadata_received_) {
253  finish_ops_.RecvInitialMetadata(context_);
254  }
255  finish_ops_.ClientRecvStatus(context_, status);
256  call_.PerformOps(&finish_ops_);
257  }
258 
259  private:
261  template <class W>
263  ::grpc_impl::ClientContext* context, const W& request,
264  bool start, void* tag)
265  : context_(context), call_(call), started_(start) {
266  // TODO(ctiller): don't assert
267  GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok());
268  init_ops_.ClientSendClose();
269  if (start) {
270  StartCallInternal(tag);
271  } else {
272  GPR_CODEGEN_ASSERT(tag == nullptr);
273  }
274  }
275 
276  void StartCallInternal(void* tag) {
277  init_ops_.SendInitialMetadata(&context_->send_initial_metadata_,
278  context_->initial_metadata_flags());
279  init_ops_.set_output_tag(tag);
280  call_.PerformOps(&init_ops_);
281  }
282 
283  ::grpc_impl::ClientContext* context_;
285  bool started_;
289  init_ops_;
291  meta_ops_;
294  read_ops_;
297  finish_ops_;
298 };
299 
301 template <class W>
305  public:
310  virtual void WritesDone(void* tag) = 0;
311 };
312 
313 namespace internal {
314 template <class W>
316  public:
328  template <class R>
331  const ::grpc::internal::RpcMethod& method,
332  ::grpc_impl::ClientContext* context,
333  R* response, bool start, void* tag) {
334  ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
336  call.call(), sizeof(ClientAsyncWriter<W>)))
337  ClientAsyncWriter<W>(call, context, response, start, tag);
338  }
339 };
340 } // namespace internal
341 
345 template <class W>
347  public:
348  // always allocated against a call arena, no memory free required
349  static void operator delete(void* /*ptr*/, std::size_t size) {
350  GPR_CODEGEN_ASSERT(size == sizeof(ClientAsyncWriter));
351  }
352 
353  // This operator should never be called as the memory should be freed as part
354  // of the arena destruction. It only exists to provide a matching operator
355  // delete to the operator new so that some compilers will not complain (see
356  // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
357  // there are no tests catching the compiler warning.
358  static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); }
359 
360  void StartCall(void* tag) override {
361  GPR_CODEGEN_ASSERT(!started_);
362  started_ = true;
363  StartCallInternal(tag);
364  }
365 
373  void ReadInitialMetadata(void* tag) override {
374  GPR_CODEGEN_ASSERT(started_);
375  GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
376 
377  meta_ops_.set_output_tag(tag);
378  meta_ops_.RecvInitialMetadata(context_);
379  call_.PerformOps(&meta_ops_);
380  }
381 
382  void Write(const W& msg, void* tag) override {
383  GPR_CODEGEN_ASSERT(started_);
384  write_ops_.set_output_tag(tag);
385  // TODO(ctiller): don't assert
386  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok());
387  call_.PerformOps(&write_ops_);
388  }
389 
390  void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
391  GPR_CODEGEN_ASSERT(started_);
392  write_ops_.set_output_tag(tag);
393  if (options.is_last_message()) {
394  options.set_buffer_hint();
395  write_ops_.ClientSendClose();
396  }
397  // TODO(ctiller): don't assert
398  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
399  call_.PerformOps(&write_ops_);
400  }
401 
402  void WritesDone(void* tag) override {
403  GPR_CODEGEN_ASSERT(started_);
404  write_ops_.set_output_tag(tag);
405  write_ops_.ClientSendClose();
406  call_.PerformOps(&write_ops_);
407  }
408 
416  void Finish(::grpc::Status* status, void* tag) override {
417  GPR_CODEGEN_ASSERT(started_);
418  finish_ops_.set_output_tag(tag);
419  if (!context_->initial_metadata_received_) {
420  finish_ops_.RecvInitialMetadata(context_);
421  }
422  finish_ops_.ClientRecvStatus(context_, status);
423  call_.PerformOps(&finish_ops_);
424  }
425 
426  private:
428  template <class R>
430  ::grpc_impl::ClientContext* context, R* response,
431  bool start, void* tag)
432  : context_(context), call_(call), started_(start) {
433  finish_ops_.RecvMessage(response);
434  finish_ops_.AllowNoMessage();
435  if (start) {
436  StartCallInternal(tag);
437  } else {
438  GPR_CODEGEN_ASSERT(tag == nullptr);
439  }
440  }
441 
442  void StartCallInternal(void* tag) {
443  write_ops_.SendInitialMetadata(&context_->send_initial_metadata_,
444  context_->initial_metadata_flags());
445  // if corked bit is set in context, we just keep the initial metadata
446  // buffered up to coalesce with later message send. No op is performed.
447  if (!context_->initial_metadata_corked_) {
448  write_ops_.set_output_tag(tag);
449  call_.PerformOps(&write_ops_);
450  }
451  }
452 
453  ::grpc_impl::ClientContext* context_;
455  bool started_;
457  meta_ops_;
461  write_ops_;
465  finish_ops_;
466 };
467 
471 template <class W, class R>
476  public:
481  virtual void WritesDone(void* tag) = 0;
482 };
483 
484 namespace internal {
485 template <class W, class R>
487  public:
497  const ::grpc::internal::RpcMethod& method,
498  ::grpc_impl::ClientContext* context, bool start, void* tag) {
499  ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
500 
502  call.call(), sizeof(ClientAsyncReaderWriter<W, R>)))
503  ClientAsyncReaderWriter<W, R>(call, context, start, tag);
504  }
505 };
506 } // namespace internal
507 
512 template <class W, class R>
514  : public ClientAsyncReaderWriterInterface<W, R> {
515  public:
516  // always allocated against a call arena, no memory free required
517  static void operator delete(void* /*ptr*/, std::size_t size) {
519  }
520 
521  // This operator should never be called as the memory should be freed as part
522  // of the arena destruction. It only exists to provide a matching operator
523  // delete to the operator new so that some compilers will not complain (see
524  // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
525  // there are no tests catching the compiler warning.
526  static void operator delete(void*, void*) { GPR_CODEGEN_ASSERT(false); }
527 
528  void StartCall(void* tag) override {
529  GPR_CODEGEN_ASSERT(!started_);
530  started_ = true;
531  StartCallInternal(tag);
532  }
533 
541  void ReadInitialMetadata(void* tag) override {
542  GPR_CODEGEN_ASSERT(started_);
543  GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
544 
545  meta_ops_.set_output_tag(tag);
546  meta_ops_.RecvInitialMetadata(context_);
547  call_.PerformOps(&meta_ops_);
548  }
549 
550  void Read(R* msg, void* tag) override {
551  GPR_CODEGEN_ASSERT(started_);
552  read_ops_.set_output_tag(tag);
553  if (!context_->initial_metadata_received_) {
554  read_ops_.RecvInitialMetadata(context_);
555  }
556  read_ops_.RecvMessage(msg);
557  call_.PerformOps(&read_ops_);
558  }
559 
560  void Write(const W& msg, void* tag) override {
561  GPR_CODEGEN_ASSERT(started_);
562  write_ops_.set_output_tag(tag);
563  // TODO(ctiller): don't assert
564  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok());
565  call_.PerformOps(&write_ops_);
566  }
567 
568  void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
569  GPR_CODEGEN_ASSERT(started_);
570  write_ops_.set_output_tag(tag);
571  if (options.is_last_message()) {
572  options.set_buffer_hint();
573  write_ops_.ClientSendClose();
574  }
575  // TODO(ctiller): don't assert
576  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
577  call_.PerformOps(&write_ops_);
578  }
579 
580  void WritesDone(void* tag) override {
581  GPR_CODEGEN_ASSERT(started_);
582  write_ops_.set_output_tag(tag);
583  write_ops_.ClientSendClose();
584  call_.PerformOps(&write_ops_);
585  }
586 
591  void Finish(::grpc::Status* status, void* tag) override {
592  GPR_CODEGEN_ASSERT(started_);
593  finish_ops_.set_output_tag(tag);
594  if (!context_->initial_metadata_received_) {
595  finish_ops_.RecvInitialMetadata(context_);
596  }
597  finish_ops_.ClientRecvStatus(context_, status);
598  call_.PerformOps(&finish_ops_);
599  }
600 
601  private:
604  ::grpc_impl::ClientContext* context, bool start,
605  void* tag)
606  : context_(context), call_(call), started_(start) {
607  if (start) {
608  StartCallInternal(tag);
609  } else {
610  GPR_CODEGEN_ASSERT(tag == nullptr);
611  }
612  }
613 
614  void StartCallInternal(void* tag) {
615  write_ops_.SendInitialMetadata(&context_->send_initial_metadata_,
616  context_->initial_metadata_flags());
617  // if corked bit is set in context, we just keep the initial metadata
618  // buffered up to coalesce with later message send. No op is performed.
619  if (!context_->initial_metadata_corked_) {
620  write_ops_.set_output_tag(tag);
621  call_.PerformOps(&write_ops_);
622  }
623  }
624 
625  ::grpc_impl::ClientContext* context_;
627  bool started_;
629  meta_ops_;
632  read_ops_;
636  write_ops_;
639  finish_ops_;
640 };
641 
642 template <class W, class R>
646  public:
669  virtual void Finish(const W& msg, const ::grpc::Status& status,
670  void* tag) = 0;
671 
693  virtual void FinishWithError(const ::grpc::Status& status, void* tag) = 0;
694 };
695 
699 template <class W, class R>
700 class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
701  public:
703  : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
704 
710  void SendInitialMetadata(void* tag) override {
711  GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
712 
713  meta_ops_.set_output_tag(tag);
714  meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
715  ctx_->initial_metadata_flags());
716  if (ctx_->compression_level_set()) {
717  meta_ops_.set_compression_level(ctx_->compression_level());
718  }
719  ctx_->sent_initial_metadata_ = true;
720  call_.PerformOps(&meta_ops_);
721  }
722 
723  void Read(R* msg, void* tag) override {
724  read_ops_.set_output_tag(tag);
725  read_ops_.RecvMessage(msg);
726  call_.PerformOps(&read_ops_);
727  }
728 
740  void Finish(const W& msg, const ::grpc::Status& status, void* tag) override {
741  finish_ops_.set_output_tag(tag);
742  if (!ctx_->sent_initial_metadata_) {
743  finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
744  ctx_->initial_metadata_flags());
745  if (ctx_->compression_level_set()) {
746  finish_ops_.set_compression_level(ctx_->compression_level());
747  }
748  ctx_->sent_initial_metadata_ = true;
749  }
750  // The response is dropped if the status is not OK.
751  if (status.ok()) {
752  finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_,
753  finish_ops_.SendMessage(msg));
754  } else {
755  finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
756  }
757  call_.PerformOps(&finish_ops_);
758  }
759 
769  void FinishWithError(const ::grpc::Status& status, void* tag) override {
770  GPR_CODEGEN_ASSERT(!status.ok());
771  finish_ops_.set_output_tag(tag);
772  if (!ctx_->sent_initial_metadata_) {
773  finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
774  ctx_->initial_metadata_flags());
775  if (ctx_->compression_level_set()) {
776  finish_ops_.set_compression_level(ctx_->compression_level());
777  }
778  ctx_->sent_initial_metadata_ = true;
779  }
780  finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
781  call_.PerformOps(&finish_ops_);
782  }
783 
784  private:
785  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
786 
790  meta_ops_;
795  finish_ops_;
796 };
797 
798 template <class W>
802  public:
824  virtual void Finish(const ::grpc::Status& status, void* tag) = 0;
825 
840  virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
841  const ::grpc::Status& status, void* tag) = 0;
842 };
843 
846 template <class W>
848  public:
850  : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
851 
859  void SendInitialMetadata(void* tag) override {
860  GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
861 
862  meta_ops_.set_output_tag(tag);
863  meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
864  ctx_->initial_metadata_flags());
865  if (ctx_->compression_level_set()) {
866  meta_ops_.set_compression_level(ctx_->compression_level());
867  }
868  ctx_->sent_initial_metadata_ = true;
869  call_.PerformOps(&meta_ops_);
870  }
871 
872  void Write(const W& msg, void* tag) override {
873  write_ops_.set_output_tag(tag);
874  EnsureInitialMetadataSent(&write_ops_);
875  // TODO(ctiller): don't assert
876  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok());
877  call_.PerformOps(&write_ops_);
878  }
879 
880  void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
881  write_ops_.set_output_tag(tag);
882  if (options.is_last_message()) {
883  options.set_buffer_hint();
884  }
885 
886  EnsureInitialMetadataSent(&write_ops_);
887  // TODO(ctiller): don't assert
888  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
889  call_.PerformOps(&write_ops_);
890  }
891 
902  void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
903  const ::grpc::Status& status, void* tag) override {
904  write_ops_.set_output_tag(tag);
905  EnsureInitialMetadataSent(&write_ops_);
906  options.set_buffer_hint();
907  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
908  write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
909  call_.PerformOps(&write_ops_);
910  }
911 
923  void Finish(const ::grpc::Status& status, void* tag) override {
924  finish_ops_.set_output_tag(tag);
925  EnsureInitialMetadataSent(&finish_ops_);
926  finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
927  call_.PerformOps(&finish_ops_);
928  }
929 
930  private:
931  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
932 
933  template <class T>
934  void EnsureInitialMetadataSent(T* ops) {
935  if (!ctx_->sent_initial_metadata_) {
936  ops->SendInitialMetadata(&ctx_->initial_metadata_,
937  ctx_->initial_metadata_flags());
938  if (ctx_->compression_level_set()) {
939  ops->set_compression_level(ctx_->compression_level());
940  }
941  ctx_->sent_initial_metadata_ = true;
942  }
943  }
944 
948  meta_ops_;
952  write_ops_;
955  finish_ops_;
956 };
957 
959 template <class W, class R>
964  public:
987  virtual void Finish(const ::grpc::Status& status, void* tag) = 0;
988 
1003  virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
1004  const ::grpc::Status& status, void* tag) = 0;
1005 };
1006 
1011 template <class W, class R>
1013  : public ServerAsyncReaderWriterInterface<W, R> {
1014  public:
1016  : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
1017 
1025  void SendInitialMetadata(void* tag) override {
1026  GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
1027 
1028  meta_ops_.set_output_tag(tag);
1029  meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
1030  ctx_->initial_metadata_flags());
1031  if (ctx_->compression_level_set()) {
1032  meta_ops_.set_compression_level(ctx_->compression_level());
1033  }
1034  ctx_->sent_initial_metadata_ = true;
1035  call_.PerformOps(&meta_ops_);
1036  }
1037 
1038  void Read(R* msg, void* tag) override {
1039  read_ops_.set_output_tag(tag);
1040  read_ops_.RecvMessage(msg);
1041  call_.PerformOps(&read_ops_);
1042  }
1043 
1044  void Write(const W& msg, void* tag) override {
1045  write_ops_.set_output_tag(tag);
1046  EnsureInitialMetadataSent(&write_ops_);
1047  // TODO(ctiller): don't assert
1048  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok());
1049  call_.PerformOps(&write_ops_);
1050  }
1051 
1052  void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
1053  write_ops_.set_output_tag(tag);
1054  if (options.is_last_message()) {
1055  options.set_buffer_hint();
1056  }
1057  EnsureInitialMetadataSent(&write_ops_);
1058  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
1059  call_.PerformOps(&write_ops_);
1060  }
1061 
1070  //
1073  void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
1074  const ::grpc::Status& status, void* tag) override {
1075  write_ops_.set_output_tag(tag);
1076  EnsureInitialMetadataSent(&write_ops_);
1077  options.set_buffer_hint();
1078  GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
1079  write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
1080  call_.PerformOps(&write_ops_);
1081  }
1082 
1091  //
1094  void Finish(const ::grpc::Status& status, void* tag) override {
1095  finish_ops_.set_output_tag(tag);
1096  EnsureInitialMetadataSent(&finish_ops_);
1097 
1098  finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
1099  call_.PerformOps(&finish_ops_);
1100  }
1101 
1102  private:
1104 
1105  void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
1106 
1107  template <class T>
1108  void EnsureInitialMetadataSent(T* ops) {
1109  if (!ctx_->sent_initial_metadata_) {
1110  ops->SendInitialMetadata(&ctx_->initial_metadata_,
1111  ctx_->initial_metadata_flags());
1112  if (ctx_->compression_level_set()) {
1113  ops->set_compression_level(ctx_->compression_level());
1114  }
1115  ctx_->sent_initial_metadata_ = true;
1116  }
1117  }
1118 
1119  ::grpc::internal::Call call_;
1122  meta_ops_;
1127  write_ops_;
1130  finish_ops_;
1131 };
1132 
1133 } // namespace grpc_impl
1134 #endif // GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_IMPL_H
grpc_impl::ServerAsyncWriterInterface::WriteAndFinish
virtual void WriteAndFinish(const W &msg, ::grpc::WriteOptions options, const ::grpc::Status &status, void *tag)=0
Request the writing of msg and coalesce it with trailing metadata which contains status,...
grpc_impl::ClientAsyncWriter::Write
void Write(const W &msg, void *tag) override
Request the writing of msg with identifying tag tag.
Definition: async_stream_impl.h:382
grpc::internal::CallOpRecvInitialMetadata
Definition: call_op_set.h:719
grpc::internal::ServerAsyncStreamingInterface
Definition: service_type.h:41
grpc::internal::CallOpClientSendClose
Definition: call_op_set.h:617
grpc_impl::ClientAsyncReaderWriter::WritesDone
void WritesDone(void *tag) override
Signal the client is done with the writes (half-close the client stream).
Definition: async_stream_impl.h:580
grpc::internal::CallOpGenericRecvMessage
Definition: call_op_set.h:524
grpc::internal::CallOpServerSendStatus
Definition: call_op_set.h:652
grpc_impl::ServerAsyncReader::Read
void Read(R *msg, void *tag) override
Read a message of type R into msg.
Definition: async_stream_impl.h:723
grpc::internal::CallOpSet
Primary implementation of CallOpSetInterface.
Definition: call_op_set.h:849
status.h
grpc::internal::CallOpSendMessage
Definition: call_op_set.h:286
grpc_impl::ServerContext::compression_level
grpc_compression_level compression_level() const
Return the compression algorithm to be used by the server call.
Definition: server_context_impl.h:215
grpc::WriteOptions::set_last_message
WriteOptions & set_last_message()
last-message bit: indicates this is the last message in a stream client-side: makes Write the equival...
Definition: call_op_set.h:161
grpc::ClientAsyncWriter
::grpc_impl::ClientAsyncWriter< W > ClientAsyncWriter
Definition: async_stream.h:49
grpc::CoreCodegenInterface::grpc_call_arena_alloc
virtual void * grpc_call_arena_alloc(grpc_call *call, size_t length)=0
grpc_impl::ServerAsyncWriter::Write
void Write(const W &msg, void *tag) override
Request the writing of msg with identifying tag tag.
Definition: async_stream_impl.h:872
grpc_impl::ServerAsyncReaderInterface::FinishWithError
virtual void FinishWithError(const ::grpc::Status &status, void *tag)=0
Indicate that the stream is to be finished with a certain non-OK status code.
grpc_impl::ClientAsyncWriter::Write
void Write(const W &msg, ::grpc::WriteOptions options, void *tag) override
Request the writing of msg using WriteOptions options with identifying tag tag.
Definition: async_stream_impl.h:390
grpc_impl::ServerAsyncReaderWriterInterface::WriteAndFinish
virtual void WriteAndFinish(const W &msg, ::grpc::WriteOptions options, const ::grpc::Status &status, void *tag)=0
Request the writing of msg and coalesce it with trailing metadata which contains status,...
grpc_impl::ClientAsyncWriter::StartCall
void StartCall(void *tag) override
Start the call that was set up by the constructor, but only if the constructor was invoked through th...
Definition: async_stream_impl.h:360
service_type.h
grpc_impl::ServerAsyncWriter::Finish
void Finish(const ::grpc::Status &status, void *tag) override
See the ServerAsyncWriterInterface.Finish method for semantics.
Definition: async_stream_impl.h:923
grpc::ClientAsyncReader
::grpc_impl::ClientAsyncReader< R > ClientAsyncReader
Definition: async_stream.h:43
grpc_impl::ServerAsyncReaderWriter::WriteAndFinish
void WriteAndFinish(const W &msg, ::grpc::WriteOptions options, const ::grpc::Status &status, void *tag) override
See the ServerAsyncReaderWriterInterface.WriteAndFinish method for semantics.
Definition: async_stream_impl.h:1073
grpc_impl::ClientAsyncWriter::ReadInitialMetadata
void ReadInitialMetadata(void *tag) override
See the ClientAsyncStreamingInterface.ReadInitialMetadata method for semantics.
Definition: async_stream_impl.h:373
grpc_impl::ClientAsyncWriterInterface
Common interface for client side asynchronous writing.
Definition: async_stream_impl.h:302
grpc_impl::ServerAsyncReader::Finish
void Finish(const W &msg, const ::grpc::Status &status, void *tag) override
See the ServerAsyncReaderInterface.Read method for semantics.
Definition: async_stream_impl.h:740
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition: call.h:38
core_codegen_interface.h
grpc::internal::CallOpSendInitialMetadata
Definition: call_op_set.h:216
grpc_impl::ServerContext::compression_level_set
bool compression_level_set() const
Return a bool indicating whether the compression level for this call has been set (either implicitly ...
Definition: server_context_impl.h:230
grpc_impl::ServerAsyncReaderWriter::Write
void Write(const W &msg, void *tag) override
Request the writing of msg with identifying tag tag.
Definition: async_stream_impl.h:1044
grpc_impl::ServerAsyncWriter::Write
void Write(const W &msg, ::grpc::WriteOptions options, void *tag) override
Request the writing of msg using WriteOptions options with identifying tag tag.
Definition: async_stream_impl.h:880
grpc::Server
::grpc_impl::Server Server
Definition: server.h:26
grpc_impl::ServerAsyncReaderWriterInterface
Server-side interface for asynchronous bi-directional streaming.
Definition: async_stream_impl.h:960
grpc_impl::internal::AsyncWriterInterface::~AsyncWriterInterface
virtual ~AsyncWriterInterface()
Definition: async_stream_impl.h:105
grpc_impl::ServerAsyncReaderWriterInterface::Finish
virtual void Finish(const ::grpc::Status &status, void *tag)=0
Indicate that the stream is to be finished with a certain status code.
grpc_impl::internal::ClientAsyncStreamingInterface::ReadInitialMetadata
virtual void ReadInitialMetadata(void *tag)=0
Request notification of the reading of the initial metadata.
grpc::Status
Did it work? If it didn't, why?
Definition: status.h:31
grpc_impl::ClientAsyncWriter
Async API on the client side for doing client-streaming RPCs, where the outgoing message stream going...
Definition: async_stream_impl.h:346
grpc_impl::ServerContext
A ServerContext or CallbackServerContext allows the code implementing a service handler to:
Definition: server_context_impl.h:510
grpc_impl::internal::ClientAsyncReaderFactory
Definition: async_stream_impl.h:170
grpc_impl::ServerAsyncWriterInterface::Finish
virtual void Finish(const ::grpc::Status &status, void *tag)=0
Indicate that the stream is to be finished with a certain status code.
grpc_impl::ServerAsyncReaderWriter::ServerAsyncReaderWriter
ServerAsyncReaderWriter(::grpc_impl::ServerContext *ctx)
Definition: async_stream_impl.h:1015
grpc_impl::internal::AsyncReaderInterface
An interface that yields a sequence of messages of type R.
Definition: async_stream_impl.h:81
grpc_impl::ClientAsyncReaderWriter::Read
void Read(R *msg, void *tag) override
Read a message of type R into msg.
Definition: async_stream_impl.h:550
grpc_impl::ServerAsyncReader::FinishWithError
void FinishWithError(const ::grpc::Status &status, void *tag) override
See the ServerAsyncReaderInterface.Read method for semantics.
Definition: async_stream_impl.h:769
grpc_impl::internal::ClientAsyncStreamingInterface
Common interface for all client side asynchronous streaming.
Definition: async_stream_impl.h:32
grpc_impl::internal::AsyncWriterInterface::Write
virtual void Write(const W &msg, void *tag)=0
Request the writing of msg with identifying tag tag.
grpc_impl::ClientAsyncReaderWriter::StartCall
void StartCall(void *tag) override
Start the call that was set up by the constructor, but only if the constructor was invoked through th...
Definition: async_stream_impl.h:528
grpc_impl::ClientAsyncReader
Async client-side API for doing server-streaming RPCs, where the incoming message stream coming from ...
Definition: async_stream_impl.h:197
grpc_impl::internal::ClientAsyncReaderWriterFactory
Definition: async_stream_impl.h:486
grpc_impl::ServerAsyncReaderInterface
Definition: async_stream_impl.h:643
grpc_impl::ServerAsyncWriter::ServerAsyncWriter
ServerAsyncWriter(::grpc_impl::ServerContext *ctx)
Definition: async_stream_impl.h:849
grpc_impl::internal::ClientAsyncReaderWriterFactory::Create
static ClientAsyncReaderWriter< W, R > * Create(::grpc::ChannelInterface *channel, ::grpc_impl::CompletionQueue *cq, const ::grpc::internal::RpcMethod &method, ::grpc_impl::ClientContext *context, bool start, void *tag)
Create a stream object.
Definition: async_stream_impl.h:495
grpc::ChannelInterface
Codegen interface for grpc::Channel.
Definition: channel_interface.h:74
grpc_impl::internal::ClientAsyncStreamingInterface::StartCall
virtual void StartCall(void *tag)=0
Start the call that was set up by the constructor, but only if the constructor was invoked through th...
grpc_impl::ServerAsyncWriter::SendInitialMetadata
void SendInitialMetadata(void *tag) override
See ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
Definition: async_stream_impl.h:859
grpc_impl::internal::ClientAsyncReaderFactory::Create
static ClientAsyncReader< R > * Create(::grpc::ChannelInterface *channel, ::grpc_impl::CompletionQueue *cq, const ::grpc::internal::RpcMethod &method, ::grpc_impl::ClientContext *context, const W &request, bool start, void *tag)
Create a stream object.
Definition: async_stream_impl.h:180
grpc_impl::ClientAsyncReaderInterface
Definition: async_stream_impl.h:164
grpc_impl::ClientAsyncReaderWriter
Async client-side interface for bi-directional streaming, where the outgoing message stream going to ...
Definition: async_stream_impl.h:513
grpc_impl::ServerAsyncReaderWriter::Read
void Read(R *msg, void *tag) override
Read a message of type R into msg.
Definition: async_stream_impl.h:1038
grpc::protobuf::util::Status
::google::protobuf::util::Status Status
Definition: config_protobuf.h:90
grpc_impl::ClientAsyncWriter::Finish
void Finish(::grpc::Status *status, void *tag) override
See the ClientAsyncStreamingInterface.Finish method for semantics.
Definition: async_stream_impl.h:416
grpc_impl::ClientAsyncReader::Read
void Read(R *msg, void *tag) override
Read a message of type R into msg.
Definition: async_stream_impl.h:234
grpc::WriteOptions
Per-message write options.
Definition: call_op_set.h:79
server_context_impl.h
grpc_impl::CompletionQueue
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue_impl.h:103
channel_interface.h
grpc_impl::ServerAsyncReaderWriter::SendInitialMetadata
void SendInitialMetadata(void *tag) override
See ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
Definition: async_stream_impl.h:1025
grpc_impl::ClientAsyncReaderWriterInterface
Async client-side interface for bi-directional streaming, where the client-to-server message stream h...
Definition: async_stream_impl.h:472
grpc::internal::Call::PerformOps
void PerformOps(CallOpSetInterface *ops)
Definition: call.h:68
grpc_impl::ServerAsyncReaderWriter::Write
void Write(const W &msg, ::grpc::WriteOptions options, void *tag) override
Request the writing of msg using WriteOptions options with identifying tag tag.
Definition: async_stream_impl.h:1052
grpc::internal::Call::call
grpc_call * call() const
Definition: call.h:72
grpc_impl::ClientAsyncReaderWriter::Finish
void Finish(::grpc::Status *status, void *tag) override
See the ClientAsyncStreamingInterface.Finish method for semantics.
Definition: async_stream_impl.h:591
call.h
grpc_impl::ClientAsyncReader::StartCall
void StartCall(void *tag) override
Start the call that was set up by the constructor, but only if the constructor was invoked through th...
Definition: async_stream_impl.h:211
grpc_impl::ClientAsyncReaderWriterInterface::WritesDone
virtual void WritesDone(void *tag)=0
Signal the client is done with the writes (half-close the client stream).
grpc::internal::CallOpClientRecvStatus
Definition: call_op_set.h:767
grpc::WriteOptions::set_buffer_hint
WriteOptions & set_buffer_hint()
Sets flag indicating that the write may be buffered and need not go out on the wire immediately.
Definition: call_op_set.h:122
grpc_impl::ServerAsyncReaderWriter
Async server-side API for doing bidirectional streaming RPCs, where the incoming message stream comin...
Definition: async_stream_impl.h:1012
grpc_impl::ServerAsyncReader
Async server-side API for doing client-streaming RPCs, where the incoming message stream from the cli...
Definition: async_stream_impl.h:700
grpc::ClientAsyncReaderWriter
::grpc_impl::ClientAsyncReaderWriter< W, R > ClientAsyncReaderWriter
Definition: async_stream.h:56
grpc_impl::ClientAsyncWriter::WritesDone
void WritesDone(void *tag) override
Signal the client is done with the writes (half-close the client stream).
Definition: async_stream_impl.h:402
grpc_impl::ServerAsyncReader::SendInitialMetadata
void SendInitialMetadata(void *tag) override
See ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
Definition: async_stream_impl.h:710
grpc_impl::internal::AsyncWriterInterface::WriteLast
void WriteLast(const W &msg, ::grpc::WriteOptions options, void *tag)
Request the writing of msg and coalesce it with the writing of trailing metadata, using WriteOptions ...
Definition: async_stream_impl.h:156
grpc_impl
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
grpc_impl::ServerAsyncReaderWriter::Finish
void Finish(const ::grpc::Status &status, void *tag) override
See the ServerAsyncReaderWriterInterface.Finish method for semantics.
Definition: async_stream_impl.h:1094
grpc_impl::ServerAsyncReader::ServerAsyncReader
ServerAsyncReader(::grpc_impl::ServerContext *ctx)
Definition: async_stream_impl.h:702
grpc_impl::internal::ClientAsyncWriterFactory
Definition: async_stream_impl.h:315
grpc_impl::internal::AsyncReaderInterface::Read
virtual void Read(R *msg, void *tag)=0
Read a message of type R into msg.
grpc_impl::internal::ClientAsyncStreamingInterface::~ClientAsyncStreamingInterface
virtual ~ClientAsyncStreamingInterface()
Definition: async_stream_impl.h:34
grpc_impl::ServerAsyncReaderInterface::Finish
virtual void Finish(const W &msg, const ::grpc::Status &status, void *tag)=0
Indicate that the stream is to be finished with a certain status code and also send out msg response ...
grpc::g_core_codegen_interface
CoreCodegenInterface * g_core_codegen_interface
Definition: completion_queue_impl.h:93
GPR_CODEGEN_ASSERT
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: core_codegen_interface.h:146
grpc_impl::ServerAsyncWriter::WriteAndFinish
void WriteAndFinish(const W &msg, ::grpc::WriteOptions options, const ::grpc::Status &status, void *tag) override
See the ServerAsyncWriterInterface.WriteAndFinish method for semantics.
Definition: async_stream_impl.h:902
grpc_impl::ClientAsyncReader::ReadInitialMetadata
void ReadInitialMetadata(void *tag) override
See the ClientAsyncStreamingInterface.ReadInitialMetadata method for semantics.
Definition: async_stream_impl.h:225
grpc::WriteOptions::is_last_message
bool is_last_message() const
Get value for the flag indicating that this is the last message, and should be coalesced with trailin...
Definition: call_op_set.h:186
grpc_impl::ClientContext
A ClientContext allows the person implementing a service client to:
Definition: client_context_impl.h:184
grpc_impl::ClientAsyncReaderWriter::ReadInitialMetadata
void ReadInitialMetadata(void *tag) override
See the ClientAsyncStreamingInterface.ReadInitialMetadata method for semantics of this method.
Definition: async_stream_impl.h:541
grpc::internal::CallOpRecvMessage
Definition: byte_buffer.h:58
grpc_impl::ClientAsyncReader::Finish
void Finish(::grpc::Status *status, void *tag) override
See the ClientAsyncStreamingInterface.Finish method for semantics.
Definition: async_stream_impl.h:249
grpc_impl::internal::AsyncReaderInterface::~AsyncReaderInterface
virtual ~AsyncReaderInterface()
Definition: async_stream_impl.h:83
grpc_impl::internal::ClientAsyncStreamingInterface::Finish
virtual void Finish(::grpc::Status *status, void *tag)=0
Indicate that the stream is to be finished and request notification for when the call has been ended.
grpc_impl::ClientAsyncReaderWriter::Write
void Write(const W &msg, ::grpc::WriteOptions options, void *tag) override
Request the writing of msg using WriteOptions options with identifying tag tag.
Definition: async_stream_impl.h:568
grpc_impl::ClientAsyncWriterInterface::WritesDone
virtual void WritesDone(void *tag)=0
Signal the client is done with the writes (half-close the client stream).
grpc_impl::internal::AsyncWriterInterface
An interface that can be fed a sequence of messages of type W.
Definition: async_stream_impl.h:103
grpc_impl::ServerAsyncWriter
Async server-side API for doing server streaming RPCs, where the outgoing message stream from the ser...
Definition: async_stream_impl.h:847
grpc_impl::internal::ClientAsyncWriterFactory::Create
static ClientAsyncWriter< W > * Create(::grpc::ChannelInterface *channel, ::grpc_impl::CompletionQueue *cq, const ::grpc::internal::RpcMethod &method, ::grpc_impl::ClientContext *context, R *response, bool start, void *tag)
Create a stream object.
Definition: async_stream_impl.h:329
grpc_impl::ClientAsyncReaderWriter::Write
void Write(const W &msg, void *tag) override
Request the writing of msg with identifying tag tag.
Definition: async_stream_impl.h:560
grpc_impl::ServerAsyncWriterInterface
Definition: async_stream_impl.h:799