• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "rxcpp/rx.hpp"
2 
3 #include "rxcpp/rx-test.hpp"
4 #include "catch.hpp"
5 
6 SCENARIO("just sample"){
7     printf("//! [just sample]\n");
8     auto values = rxcpp::observable<>::just(1);
9     values.
10         subscribe(
__anon963d0dd50102(int v)11             [](int v){printf("OnNext: %d\n", v);},
__anon963d0dd50202()12             [](){printf("OnCompleted\n");});
13     printf("//! [just sample]\n");
14 }
15 
16 SCENARIO("threaded just sample"){
17     printf("//! [threaded just sample]\n");
18     auto values = rxcpp::observable<>::just(1, rxcpp::observe_on_event_loop());
19     values.
20         as_blocking().
21         subscribe(
__anon963d0dd50302(int v)22             [](int v){printf("OnNext: %d\n", v);},
__anon963d0dd50402()23             [](){printf("OnCompleted\n");});
24     printf("//! [threaded just sample]\n");
25 }
26