-
Notifications
You must be signed in to change notification settings - Fork 5
task_executor
Dmitry Koplyarov edited this page May 17, 2016
·
4 revisions
An abstract base class that represents a task queue.
Here is the tutorial section.
Defined in wigwag/task_executor.hpp
struct task_executor
{
virtual ~task_executor() { }
virtual void add_task(std::function<void()> task) = 0;
};thread_task_executor is a task_executor that processes its task queue in its own thread.
threadless_task_executor is a task_executor with a public method that processes its task queue.
void add_task(std::function<void()> task);Puts a task into a queue.
Thread safety: Depends on the interface implementation. See thread_task_executor, threadless_task_executor.
Arguments:
- task - an std::function that should be executed in the task_executor