You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
auto handler_next = [ ] (evt_t i) {throw "aaa";};
auto handler_error = [ ] (auto e) { console::error("on_error: "s + e); };
...
auto observable = rx::observable<>::create(on_subscribe);
auto subscription = observable.subscribe(handler_next,
handler_error,
handler_completed);
...
output>
[11:47:53] [LOG] ----- test start -----
[11:47:53] [ERROR] on_error: aaa
[11:47:53] [LOG] on_dispose
[11:47:53] [LOG] ----- test end -----
But according to
https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines#53-protect-calls-to-user-code-from-within-an-operator
Note: do not protect calls to subscribe, dispose, onNext, onError and onCompleted methods.
These calls are on the edge of the monad.
Calling the onError method from these places will lead to unexpected behavior.
Q2 : Does Rx Specification exist ? where?
The text was updated successfully, but these errors were encountered:
cult54321
changed the title
[Question] rxcpp protects on_next. is this intentional?
[Question] rxcpp protects on_next. Is this intentional?
Sep 8, 2015
The guideline referenced is intended for operator implementation. The protection for on_next is in the subscriber which enforces the observer contract (zero or more on_next followed by either one on_error or one on_completed and then the final unsubscribe).
My primary source for the specification was the Rx.Net source. There have been some changes inspired by RxJava and some others to embrace pay-for-play in C++
There are a variety of articles that explain the contracts for Observable, Observer, Disposable and Scheduler. I have read many - it is somewhat like monad tutorials, there is always a new one begin written..
I would suggest looking at rxmarbles and the learnrx tutorial as good starting places.
Q1 : rxcpp protects on_next. Is this intentional?
But according to
Q2 : Does Rx Specification exist ? where?
The text was updated successfully, but these errors were encountered: