libcoro  1.0
Coroutine support library for C++20

◆ run() [2/4]

template<typename CondVar >
template<typename T , std::invocable< notify_t > ResumeCB>
decltype(auto) coro::scheduler_t< CondVar >::run ( future< T > &&  fut,
ResumeCB &&  cb 
)
inline

run the scheduler in signle thread mode, stop when future is ready

Parameters
futreference to future, which is awaited
cbcallback function which is responsible to resume expired items. This argument is optional. You can specify own function, or you can use coro::scheduler::thread_pool() function to connect a thread pool for this feature. If not specified, expired items are resumed in the current thread
Returns
return value of the future

Definition at line 132 of file scheduler.h.