Skip to content

thread_task_executor

Dmitry Koplyarov edited this page May 17, 2016 · 6 revisions

Back to reference

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<>;

Table of contents

Template arguments

Policies_...

The custom policies list. You can read more in this tutorial section.

Supported policies:

Constructors

variadic arguments constructor

template < typename... Args_ >
basic_thread_task_executor(Args_&... args);

Forwards the arguments to the exception_handling policy constructor.

Arguments:

Methods

add_task

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

Clone this wiki locally