ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
rppgrpc::server_write_reactor< Response > Class Template Referencefinal

RPP's based implementation for grpc server write reactor. More...

#include <server_reactor.hpp>

Detailed Description

template<rpp::constraint::decayed_type Response>
class rppgrpc::server_write_reactor< Response >

RPP's based implementation for grpc server write reactor.

To use it you need:

  • create it via new operator
  • return it from write-based method of CallbackService interface
  • reactor provides reactor->get_observable() method but such as observable emits nothing and can be used only to be notified about completion/error
  • to pass values TO stream you can emit values to observer obtained via reactor->get_observer()
grpc::ServerWriteReactor<Response>* ServerSide(grpc::CallbackServerContext* /*context*/, const Request* /*request*/) override
{
const auto reactor = new rppgrpc::server_write_reactor<Response>();
reactor->get_observable().subscribe([](rpp::utils::none) {}, []() { std::cout << "DONE" << std::endl; });
reactor->get_observer().on_next(Response{});
return reactor;
}
Examples
server_reactor.cpp.

The documentation for this class was generated from the following files: