ulib/3party/rxcpp/Rx/v2/examples/doxygen/never.cpp
2024-01-10 09:33:36 +08:00

16 lines
442 B
C++

#include "rxcpp/rx.hpp"
#include "rxcpp/rx-test.hpp"
#include "catch.hpp"
SCENARIO("never sample"){
printf("//! [never sample]\n");
auto values = rxcpp::observable<>::never<int>();
values.
take_until(std::chrono::steady_clock::now() + std::chrono::milliseconds(10)).
subscribe(
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
printf("//! [never sample]\n");
}