Last active
February 8, 2018 07:47
-
-
Save Razzo78/b73bb79ed7b9a9d265a47bad232e7b3b to your computer and use it in GitHub Desktop.
C++, ReactiveX - How to call on_next from a declared observable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rxcpp::subjects::subject<int> sub; | |
auto o = sub.get_subscriber(); | |
auto source = sub.get_observable(); | |
source.subscribe( | |
[](int v) {printf("OnNext: %d\n", v); }, | |
[]() {printf("OnCompleted\n"); }); | |
o.on_next(1); | |
o.on_next(2); | |
o.on_next(3); | |
o.on_completed(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment