#include <eventloop.hpp>
|
EventLoopPrivate * | _p |
|
std::string | _name |
|
Definition at line 35 of file eventloop.hpp.
qi::EventLoop::EventLoop |
( |
const std::string & |
name = "eventloop" | ) |
|
qi::EventLoop::~EventLoop |
( |
| ) |
|
template<typename R >
Future< R > qi::EventLoop::async |
( |
boost::function< R()> |
callback, |
|
|
uint64_t |
usDelay = 0 |
|
) |
| |
Call given function once after given delay in microseconds.
- Returns
- a canceleable future
Definition at line 51 of file eventloop.hxx.
Future<void> qi::EventLoop::async |
( |
boost::function< void()> |
callback, |
|
|
uint64_t |
usDelay = 0 |
|
) |
| |
bool qi::EventLoop::isInEventLoopThread |
( |
| ) |
|
Return true if current thread is the event loop thread.
void qi::EventLoop::join |
( |
| ) |
|
Wait for run thread to terminate.
Monitor event loop to detect deadlocks.
- Parameters
-
helper | an other event loop used for monitoring |
maxUsDelay | maximum expected delay between an async() and its execution |
- Returns
- a canceleable future. Invoke cancel() to terminate monitoring. In case an async() call does not execute in time, the future's error will be set.
void* qi::EventLoop::nativeHandle |
( |
| ) |
|
void qi::EventLoop::post |
( |
const boost::function< void()> & |
callback, |
|
|
uint64_t |
usDelay = 0 |
|
) |
| |
Similar to async() but without cancelation or notification.
void qi::EventLoop::run |
( |
| ) |
|
Run main loop in current thread.
void qi::EventLoop::setEmergencyCallback |
( |
boost::function< void()> |
cb | ) |
|
Set callback to be called in case of a deadlock detection.
void qi::EventLoop::setMaxThreads |
( |
unsigned int |
max | ) |
|
Set the maximum number of threads in the pool.
void qi::EventLoop::start |
( |
int |
nthreads = 0 | ) |
|
void qi::EventLoop::startThreadPool |
( |
int |
minWorkers = -1 , |
|
|
int |
maxWorkers = -1 , |
|
|
int |
minIdleWorkers = -1 , |
|
|
int |
maxIdleWorkers = -1 |
|
) |
| |
Start in thread-pool mode: each asyncCall() will be run in parallel.
void qi::EventLoop::stop |
( |
| ) |
|
Ask main loop to terminate.
std::string qi::EventLoop::_name |
EventLoopPrivate* qi::EventLoop::_p |
The documentation for this class was generated from the following files: