dispenso
A library for task parallelism
 
Loading...
Searching...
No Matches
dispenso::ImmediateInvoker Class Reference

#include <schedulable.h>

Public Member Functions

template<typename F >
void schedule (F &&f) const
 
template<typename F >
void schedule (F &&f, ForceQueuingTag) const
 

Detailed Description

A class fullfilling the Schedulable concept that immediately invokes the functor. This can be used in place of ThreadPool or TaskSet with Futures at construction or through then, or it may be used in TimedTask scheduling for short-running tasks.

Definition at line 27 of file schedulable.h.

Member Function Documentation

◆ schedule() [1/2]

template<typename F >
void dispenso::ImmediateInvoker::schedule ( F &&  f) const
inline

Schedule a functor to be executed. It will be invoked immediately.

Parameters
fThe functor to be executed. f's signature must match void(). Best performance will come from passing lambdas, other concrete functors, or OnceFunction, but std::function or similarly type-erased objects will also work.

Definition at line 37 of file schedulable.h.

◆ schedule() [2/2]

template<typename F >
void dispenso::ImmediateInvoker::schedule ( F &&  f,
ForceQueuingTag   
) const
inline

Schedule a functor to be executed. It is a bit oxymoronical to call this function, since ForceQueuingTag will have no effect, and it's use is discouraged.

Definition at line 47 of file schedulable.h.


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