ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
rpp::schedulers::run_loop Class Referencefinal

scheduler which schedules execution via queueing tasks, but execution of tasks should be manually dispatched More...

#include <run_loop_scheduler.hpp>

Inheritance diagram for rpp::schedulers::run_loop:
rpp::schedulers::details::scheduler_tag

Public Member Functions

 run_loop (const composite_subscription &sub=composite_subscription{})
 
auto create_worker (const composite_subscription &sub=composite_subscription{}) const
 
bool is_empty () const
 
bool is_any_ready_schedulable () const
 
void dispatch_if_ready () const
 
void dispatch () const
 

Detailed Description

scheduler which schedules execution via queueing tasks, but execution of tasks should be manually dispatched

Warning
you need manually dispatch events for this scheduler in some thread.
Example
auto sub = rpp::source::just(10, 15, 20)
.observe_on(run_loop)
.subscribe([](int v) { std::cout << v << "\n"; });
// No output
while (sub.is_subscribed())
{
while (run_loop.is_any_ready_schedulable())
run_loop.dispatch();
}
// Output:
// 10
// 15
// 20
scheduler which schedules execution via queueing tasks, but execution of tasks should be manually dis...
Definition: run_loop_scheduler.hpp:30
Examples
run_loop.cpp.

The documentation for this class was generated from the following file: