Questions tagged [rxcpp]

Reactive Extensions for C++ (rxcpp) is a C++ library of algorithms that coordinate values distributed in time. rxcpp is like the STL algorithms that process values distributed in space, but for async values like network packets, IO and mouse events.

rxcpp is on github

34 questions
11
votes
1 answer

Schedulers in Rxcpp

I'm trying to figure out the scheduling model in the C++ version of Rx. Knowing the C# version where there is a simple interface with one Schedule method; The C++ version seems rather complex, with stuff like scheduler, worker, and coordination.…
Michael Sutton
  • 298
  • 2
  • 9
7
votes
1 answer

llvm error: Relocation not implemented yet! when running RxCpp in orcjit or lli

I would like to run RxCpp example in llvm's IR interpreter lli. Unfortunately, running any of the RxCpp examples fails in lli: git clone https://github.com/Reactive-Extensions/RxCpp.git --depth 1 cd RxCpp/Rx/v2/examples/pythogerian clang++ -S…
Gaetano
  • 967
  • 1
  • 9
  • 23
5
votes
1 answer

RxCpp: observer's lifetime if using observe_on(rxcpp::observe_on_new_thread())

What is the proper way to wait until all the observers on_completed are called if the observers are using observe_on(rxcpp::observe_on_new_thread()): For example: { Foo foo; auto generator = [&](rxcpp::subscriber s) { …
LMC
  • 292
  • 3
  • 13
4
votes
1 answer

Empty angle brackets in C++

When exploring RxCpp library I encountered the following sample which I cannot interpret. auto ints = rxcpp::observable<>::create( [](rxcpp::subscriber s){ s.on_next(1); s.on_next(2); …
Mooh
  • 684
  • 4
  • 21
4
votes
1 answer

RX - how to use it in a performant way?

I am trying to understand how to structure my program to use RX in a performant matter.My app has a vector of objects in the 3D world. each object occupied a box, and have a 'hit' stream, which represent a mouse hover over it. I thought of two…
ShaulF
  • 591
  • 6
  • 13
3
votes
0 answers

RxCpp RAII observable subscription

I am using RxCpp in a model-view setting. A view update method is subscribed to an observable (via lambda capturing this). Undefined memory access would ensue if the subscription were to outlive the view instance. I do not want the subscription to…
Jonathan Zrake
  • 563
  • 5
  • 9
3
votes
1 answer

RXCPP: Timeout on blocking function

Consider a blocking function: this_thread::sleep_for(milliseconds(3000)); I'm trying to get the following behavior: Trigger Blocking Function |---------------------------------------------X I want to trigger the blocking function…
jc211
  • 197
  • 1
  • 8
3
votes
1 answer

rxcpp simple observable

I program with RX in C#, and now I wish to program with rxcpp in c++. I am trying to do the simplest thing, define a class member variable of observable. The problem is that observable is defined as: template
ShaulF
  • 591
  • 6
  • 13
3
votes
1 answer

How to call on_error on a custom rxcpp operator

I've created a simple rx operator that converts a stream of strings to a stream of jsons and it works fine. However, I would like to be able to raise a custom exception and I am not sure how to call the on_error method of the subscription The…
Ciprian
  • 507
  • 4
  • 12
3
votes
1 answer

rxcpp: nested while loop or similar "classic" imperative structure for program

I have a device that streams some events. I want to use reactive extensions to model the following behavior: Detect when a user connects a dongle (my program checks for events for dongle connected). Start to capture a stream of data from the dongle…
Germán Diago
  • 6,892
  • 1
  • 30
  • 54
3
votes
1 answer

rxcpp - why don't all observers' on_next function get called when an observable emits a value

I'm trying to understand how to use rxcpp, my impression was that when an observable emits a value, all observers who are subscribed will get notified by having their their on_next() methods called, passing them the emitted value. This is not the…
nbdy_
  • 629
  • 1
  • 7
  • 17
3
votes
1 answer

Create an Observable you can unsubscribe from in RxCpp

I'm porting some code from C# that heavily relies on Rx, and I have difficulties finding C++ equivalents to some of the most used C# methods. In particular, I want to create an observable from the subscription/unsubscription logic. In C#, I use the…
Falanwe
  • 4,445
  • 20
  • 37
2
votes
1 answer

RxCpp calls copy constructor a lot

I am trying to include RxCpp in my program and I noticed, that the framework calls the copy constructor of emitted objects quite a lot. #include #include class Foo { public: Foo() = default; Foo(Foo const &other) …
Link64
  • 669
  • 5
  • 18
2
votes
1 answer

Creating custom operators in rxcpp

I am trying to learn how to create custom operators in rxcpp, and I was able to create operators as sited in here. But, I would like to learn how to create more generic operators implementing rxo::operator_base and using lift operator. Is there any…
2
votes
1 answer

How to handle a request/response stream in rxcpp

I need to implement a camera sampling system in rxcpp.. The way I imagined this is passing a requestStream as param and receiving a responseStream Every time requestSample is called, a new camera session is created and when on_complete() is called…
Ciprian
  • 507
  • 4
  • 12
1
2 3