Home | History | Annotate | Download | only in doxygen
      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(
     11             [](int v){printf("OnNext: %d\n", v);},
     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(
     22             [](int v){printf("OnNext: %d\n", v);},
     23             [](){printf("OnCompleted\n");});
     24     printf("//! [threaded just sample]\n");
     25 }
     26