Stores and executes functions.
More...
#include <action_queue.hpp>
|
| action_queue (ioc_t ioc) |
| Construct the action queue. It will not execute anything until run() is called.
|
|
void | push (act_t act) |
| Add an action to the queue.
|
|
void | run () |
| Starts the queue running, if it isn't already.
|
|
template<typename Executor>
class malloy::detail::action_queue< Executor >
Stores and executes functions.
The next queued function is not executed until the callback passed to the last executed function is called
- Note
- All methods in this class are threadsafe
-
This class will be upgraded to coroutines once they become sufficently supported, see https://github.com/Tectu/malloy/issues/70 for more details
- Warning
- The callback passed must be called for the queue to continue running
-
Objects of this class do no explicit lifetime management for themselves. It is up to the owner of the object to ensure it is still alive when the callback is invoked
- Template Parameters
-
Executor | The executor to use |
◆ action_queue()
template<typename Executor >
Construct the action queue. It will not execute anything until run() is called.
- Parameters
-
ioc | The strand to use for synchronisation |
◆ push()
template<typename Executor >
Add an action to the queue.
- Note
- If run() has been called and the queue is currently empty, the new action will run immediately.
- Parameters
-
◆ run()
template<typename Executor >
Starts the queue running, if it isn't already.
- Note
- Only needs to be called once.
The documentation for this class was generated from the following file: