Repository navigation
threadless_task_executor
Dmitry Koplyarov edited this page Aug 24, 2016
·
5 revisions
A task_executor with a public method that processes its task queue.
Defined in wigwag/threadless_task_executor.hpp
template < typename... Policies_ >
class basic_threadless_task_executor : public task_executor
{
public:
template < typename... Args_ >
basic_threadless_task_executor(Args_&&... args);
void process_tasks();
void add_task(std::function<void()> task);
};
using threadless_task_executor = basic_threadless_task_executor<>;The custom policies list. You can read more in this tutorial section.
Supported policies:
template < typename... Args_ >
basic_threadless_task_executor(Args_&... args);Forwards the arguments to the exception_handling policy constructor.
Arguments:
- args... - forwarded to the exception_handling policy constructor
void process_tasks();Synchronously executes all the tasks in the queue.
void add_task(std::function<void()> task);Puts a task into a queue.
Thread safety: This is a thread-safe method as long as the threading policy assures that.
Arguments:
- task - an std::function that should be executed in the task_executor