|
using | WorkFunc = std::function< void()> |
|
|
void | run () |
| Runs the event loop. More...
|
|
bool | runFor (const std::chrono::milliseconds &msecs) |
| Runs the event loop for msecs milliseconds. More...
|
|
bool | runUntil (const std::chrono::steady_clock::time_point &deadline) |
| Runs the event loop until the deadline time passes. More...
|
|
void | exit () |
| Unblocks the runXXX functions.
|
|
bool | doWork (WorkFunc &&work) |
| Posts a work job onto the queue and waits till it completes. More...
|
|
bool | postWork (WorkFunc &&work) |
| Posts a work job onto the queue. More...
|
|
◆ doWork()
bool DobbyWorkQueue::doWork |
( |
WorkFunc && |
work | ) |
|
Posts a work job onto the queue and waits till it completes.
This queues the work item and then returns. It is thread safe, it is safe to call from the thread running the event loop or from another thread.
- Parameters
-
[in] | work | The work function to execute. |
- Returns
- true.
◆ postWork()
bool DobbyWorkQueue::postWork |
( |
WorkFunc && |
work | ) |
|
Posts a work job onto the queue.
This just queues the work item and then returns. It is thread safe, it is safe to call from the thread running the event loop or from another thread.
- Parameters
-
[in] | work | The work function to execute. |
- Returns
- true.
◆ run()
void DobbyWorkQueue::run |
( |
| ) |
|
Runs the event loop.
This will block - running the event loop until exit() is called.
◆ runFor()
bool DobbyWorkQueue::runFor |
( |
const std::chrono::milliseconds & |
msecs | ) |
|
Runs the event loop for msecs milliseconds.
This will block - running the event loop for a fixed amount of time. This will return when either the timeout expires or exit() is called.
- Parameters
-
[in] | deadline | The deadline time. |
- Returns
- true.
◆ runUntil()
bool DobbyWorkQueue::runUntil |
( |
const std::chrono::steady_clock::time_point & |
deadline | ) |
|
Runs the event loop until the deadline time passes.
This will block - running the event loop for a fixed amount of time. This will return when either the timeout expires or exit() is called.
- Parameters
-
[in] | deadline | The deadline time. |
- Returns
- true.
The documentation for this class was generated from the following files: