|
libqi-api
2.4.3.28
|
#include <strand.hpp>
Public Member Functions | |
| Strand () | |
| Construct a strand that will schedule work on the default event loop. More... | |
| Strand (qi::ExecutionContext &executionContext) | |
| Construct a strand that will schedule work on executionContext. More... | |
| ~Strand () | |
| void | post (const boost::function< void()> &callback) |
| post a callback to be executed as soon as possible More... | |
| qi::Future< void > | async (const boost::function< void()> &cb, qi::SteadyClockTimePoint tp) |
| call a callback asynchronously to be executed on tp More... | |
| qi::Future< void > | async (const boost::function< void()> &cb, qi::Duration delay=qi::Duration(0)) |
| call a callback asynchronously to be executed in delay More... | |
| bool | isInThisContext () |
| return true if the current thread is in this context More... | |
Public Member Functions inherited from qi::ExecutionContext | |
| virtual | ~ExecutionContext () |
| template<typename R > | |
| boost::disable_if < boost::is_same< R, void > , qi::Future< R > >::type | async (const boost::function< R()> &callback, qi::Duration delay=qi::Duration(0)) |
| call a callback asynchronously to be executed in delay More... | |
| template<typename R > | |
| boost::disable_if < boost::is_same< R, void > , qi::Future< R > >::type | async (const boost::function< R()> &callback, qi::SteadyClockTimePoint tp) |
| call a callback asynchronously to be executed on tp More... | |
Class that schedules tasks sequentially
A strand allows one to schedule work on an eventloop with the guaranty that two callback will never be called concurrently.
Methods are thread-safe except for destructor which must never be called concurrently.
Definition at line 31 of file strand.hpp.
| qi::Strand::Strand | ( | ) |
Construct a strand that will schedule work on the default event loop.
| qi::Strand::Strand | ( | qi::ExecutionContext & | executionContext | ) |
Construct a strand that will schedule work on executionContext.
| qi::Strand::~Strand | ( | ) |
Destroys the strand
This will wait for all scheduled tasks to finish
|
virtual |
call a callback asynchronously to be executed on tp
Implements qi::ExecutionContext.
|
virtual |
call a callback asynchronously to be executed in delay
Implements qi::ExecutionContext.
|
virtual |
return true if the current thread is in this context
Implements qi::ExecutionContext.
|
virtual |
post a callback to be executed as soon as possible
Implements qi::ExecutionContext.