Namespaces
Variants

std::execution::run_loop::get_scheduler

From cppreference.com
 
 
Execution control library
Execution concepts
Execution components
Execution contexts
Execution domains
Forward progress guarantee
Environments
    
    
    
Queries
Completion signatures
Sender adaptor closures
Coroutine utility
 
 
/*run-loop-scheduler*/ get_scheduler() noexcept;
(since C++26)

Obtains a scheduler associated with the run_loop object.

The returned object has an unspecified type, denoted here as /*run-loop-scheduler*/, that models scheduler.

Return value

An instance of /*run-loop-scheduler*/ that can be used to schedule work onto this run_loop instance.

Notes

Scheduler objects obtained from a run_loop remain valid until the end of the lifetime of the run_loop object from which they were obtained.

Two /*run-loop-scheduler*/ objects compare equal if and only if they were obtained from the same run_loop object.

Calling schedule on the returned scheduler creates a sender associated with this run_loop. When the resulting operation state is started, the work is enqueued in the loop and is executed by a subsequent call to run.

Example