MCPcopy Create free account
hub / github.com/AlexInLog/ReactivePlusPlus / main

Function main

src/examples/rpp/doxygen/as_blocking.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 **/
10
11int main() // NOLINT(bugprone-exception-escape)
12{
13 //! [as_blocking]
14 rpp::source::just(1)
15 | rpp::operators::delay(std::chrono::seconds{1}, rpp::schedulers::new_thread{}) // <-- emit from another thread with delay
16 | rpp::operators::as_blocking()
17 | rpp::operators::subscribe([](int) {}, []() { std::cout << "COMPLETED" << std::endl; });
18 std::cout << "done" << std::endl;
19 // output: COMPLETED done
20 //! [as_blocking]
21}

Callers

nothing calls this directly

Calls 4

justFunction · 0.85
delayFunction · 0.85
as_blockingFunction · 0.85
subscribeFunction · 0.85

Tested by

no test coverage detected