Modules | |
Factories | |
Classes | |
struct | IScheduler |
A thread-pool scheduler that supports scheduling one-off functions as well as dependency graphs. More... | |
class | SchedulerPtr |
A thread-pool scheduler that supports scheduling one-off functions as well as dependency graphs. More... | |
Functions | |
daq::AwaitablePtr | scheduleFunction (const daq::FunctionPtr &function) const |
Schedules the specified work function to run on the thread-pool. The call does not block but immediately returns an awaitable that represents the asynchronous execution. It can be waited upon and queried for status and result. More... | |
void | scheduleWork (const daq::WorkPtr &work) const |
Schedules the specified work callback to run on the thread-pool. The call does not block. More... | |
daq::AwaitablePtr | scheduleGraph (const daq::TaskGraphPtr &graph) const |
Schedules the specified dependency graph to run on the thread-pool. The call does not block but immediately returns an awaitable that represents the asynchronous execution. It can be waited upon and queried for status and result. Any exceptions that occur during the graph execution are silently ignored. More... | |
void | stop () const |
Cancels all outstanding work and waits for the remaining to complete. After this point the scheduler does not allow any new work or graphs for scheduling. | |
void | waitAll () const |
Waits fo all current scheduled work and tasks to complete. | |
daq::Bool | isMultiThreaded () const |
Returns whether more than one worker thread is used. More... | |
|
inline |
Returns whether more than one worker thread is used.
true
if more that one worker thread is used by the scheduler.
|
inline |
Schedules the specified work
function to run on the thread-pool. The call does not block but immediately returns an awaitable
that represents the asynchronous execution. It can be waited upon and queried for status and result.
function | The function to schedule for execution. |
OpendaqErrException | when the scheduler already stopped and is not accepting any more work. |
|
inline |
Schedules the specified dependency graph
to run on the thread-pool. The call does not block but immediately returns an awaitable
that represents the asynchronous execution. It can be waited upon and queried for status and result. Any exceptions that occur during the graph execution are silently ignored.
graph | The dependency graph (acyclic directed graph) to schedule. |
OpendaqErrException | when the scheduler already stopped and is not accepting any more work. |
|
inline |
Schedules the specified work callback to run on the thread-pool. The call does not block.
work | The function to schedule for execution. |
OpendaqErrException | when the scheduler already stopped and is not accepting any more work. |
Work is a lightweight callback that returns no value and accepts no procedure. It has less overhead than function. The function does not return awaitable object.