-
Notifications
You must be signed in to change notification settings - Fork 5
thread_task_executor
Dmitry Koplyarov edited this page May 17, 2016
·
6 revisions
A task_executor that processes its task queue in its own thread
Defined in wigwag/thread_task_executor.hpp
template < typename... Policies_ >
class basic_thread_task_executor : public task_executor
{
public:
template < typename... Args_ >
basic_thread_task_executor(Args_&&... args);
void add_task(std::function<void()> task);
};
using thread_task_executor = basic_thread_task_executor<>;The custom policies list. You can read more in this tutorial section.
Supported policies:
template < typename... Args_ >
basic_thread_task_executor(Args_&... args);Forwards the arguments to the exception_handling policy constructor.
Arguments:
- args... - forwarded to the exception_handling policy constructor
void add_task(std::function<void()> task);Puts a task into a queue.
Thread safety: This is a thread-safe method.
Arguments:
- task - an std::function that should be executed in the task_executor