ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
rppgrpc::client_write_reactor< Request > Class Template Reference

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

#include <client_reactor.hpp>

Public Member Functions

void init ()
 

Detailed Description

template<rpp::constraint::decayed_type Request>
class rppgrpc::client_write_reactor< Request >

RPP's based implementation for grpc client write reactor.

To use it you need:

  • create it via new operator
  • pass it to stub->async()->GrpcWriteStream(ctx, &request, reactor);
  • call reactor->init() method for actual starting of grpc logic
  • to pass values TO stream you can emit values to observer obtained via reactor->get_observer()
  • reactor provides reactor->get_observable() method but such as observable emits nothing and can be used only to be notified about completion/error
auto channel = grpc::CreateChannel("localhost:50051", grpc::InsecureChannelCredentials());
auto stub = TestService::NewStub(channel);
grpc::ClientContext ctx{};
const auto reactor = new rppgrpc::client_write_reactor<Request>();
Response resp{};
stub->async()->ClientSide(&ctx, &resp, reactor);
reactor->get_observable().subscribe([](const rpp::utils::none&) {});
reactor->init();
reactor->get_observer().on_next(Request{});
Examples
client_reactor.cpp.

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