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

40 questions
12
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
  • 418
  • 3
  • 9
6
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
  • 1,090
  • 1
  • 9
  • 25
5
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
  • 744
  • 5
  • 25
5
votes
1 answer

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
  • 603
  • 6
  • 9
5
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
  • 397
  • 2
  • 9
5
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_
  • 729
  • 1
  • 9
  • 18
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
  • 302
  • 3
  • 13
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
  • 841
  • 10
  • 17
3
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
  • 718
  • 4
  • 20
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
  • 841
  • 10
  • 17
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
  • 1,125
  • 1
  • 9
  • 14
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
  • 7,473
  • 1
  • 36
  • 59
3
votes
2 answers

Scheduling and Timeout handling with rxcpp

I'm new to using rxcpp and trying to get something functional together in the following scenario: I have one data source that will retrieve commands from a separate source, the code I'm writing will retrieve these commands into an rxcpp observable.…
Pierre Andersson
  • 320
  • 2
  • 12
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,636
  • 22
  • 37
2
votes
0 answers

RxCPP how to subscribe to an observable created from an STL container that is continously being modified

newbie on RxCPP still learning... I have a vector of items that is being modified continously by some thread. I want to be able to subscribe to this vector overtime and call onNext whenever something gets pushed. void updateVec(std::vector &…
Xiyang Liu
  • 81
  • 5
1
2 3