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

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

#include <client_reactor.hpp>

Public Member Functions

void init ()
 

Detailed Description

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

RPP's based implementation for grpc client read reactor.

To use it you need:

  • create it via new operator
  • pass it to stub->async()->GrpcReadStream(ctx, &response, reactor);
  • call reactor->init() method for actual starting of grpc logic
  • to access values FROM stream you can subscribe to observable obtained via reactor->get_observable() (same observable WOULD emit on_completed in case of successful stream termination and on_error in case of some errors with grpc stream)
auto channel = grpc::CreateChannel("localhost:50051", grpc::InsecureChannelCredentials());
auto stub = TestService::NewStub(channel);
grpc::ClientContext ctx{};
const auto reactor = new rppgrpc::client_read_reactor<Response>();
Request req{};
stub->async()->ServerSide(&ctx, &req, reactor);
reactor->get_observable().subscribe([](const Response&) {});
reactor->init();
Examples
client_reactor.cpp.

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