37 class server_bidi_reactor final :
public grpc::ServerBidiReactor<Request, Response>
41 using Base = grpc::ServerBidiReactor<Request, Response>;
46 Base::StartSendInitialMetadata();
47 details::base_reader<Request>::handle_read_done(
true);
54 void start_write(
const Response& v)
override
59 void start_read(Request& data)
override
61 Base::StartRead(&data);
64 void finish_writes(
const grpc::Status& status)
override
69 void OnReadDone(
bool ok)
override
74 details::base_reader<Request>::handle_read_done();
77 void OnWriteDone(
bool ok)
override
82 details::base_writer<Response>::handle_write_done();
85 void OnDone()
override
87 details::base_writer<Response>::handle_on_done();
88 details::base_reader<Request>::handle_on_done({});
93 void OnCancel()
override
95 details::base_writer<Response>::handle_on_done();
98 Base::Finish(grpc::Status::CANCELLED);
115 class server_write_reactor final :
public grpc::ServerWriteReactor<Response>
119 using Base = grpc::ServerWriteReactor<Response>;
122 server_write_reactor()
124 Base::StartSendInitialMetadata();
131 void start_write(
const Response& v)
override
133 Base::StartWrite(&v);
138 void finish_writes(
const grpc::Status& status)
override
140 Base::Finish(status);
143 void OnWriteDone(
bool ok)
override
147 Base::Finish(grpc::Status::OK);
151 details::base_writer<Response>::handle_write_done();
154 void OnDone()
override
156 details::base_writer<Response>::handle_on_done();
157 details::base_reader<rpp::utils::none>::handle_on_done({});
162 void OnCancel()
override
164 details::base_writer<Response>::handle_on_done();
167 Base::Finish(grpc::Status::CANCELLED);
183 class server_read_reactor final :
public grpc::ServerReadReactor<Request>
186 using Base = grpc::ServerReadReactor<Request>;
189 server_read_reactor()
191 Base::StartSendInitialMetadata();
192 details::base_reader<Request>::handle_read_done(
true);
198 void start_read(Request& data)
override
200 Base::StartRead(&data);
203 void OnReadDone(
bool ok)
override
207 Base::Finish(grpc::Status::OK);
211 details::base_reader<Request>::handle_read_done();
214 void OnDone()
override
216 details::base_reader<Request>::handle_on_done({});
221 void OnCancel()
override