libfly  6.2.2
C++20 utility library for Linux, macOS, and Windows
fly::task::ParallelTaskRunner Class Reference

#include <task_runner.hpp>

Inheritance diagram for fly::task::ParallelTaskRunner:
Collaboration diagram for fly::task::ParallelTaskRunner:

Static Public Member Functions

static std::shared_ptr< ParallelTaskRunnercreate (std::shared_ptr< TaskManager > task_manager)
 

Protected Member Functions

 ParallelTaskRunner (std::shared_ptr< TaskManager > task_manager) noexcept
 
bool post_task_internal (TaskLocation &&location, Task &&task) override
 
void task_complete (TaskLocation &&location) override
 
- Protected Member Functions inherited from fly::task::TaskRunner
 TaskRunner (std::shared_ptr< TaskManager > task_manager) noexcept
 
bool post_task_to_task_manager (TaskLocation &&location, Task &&task)
 
bool post_task_to_task_manager_with_delay (TaskLocation &&location, std::chrono::milliseconds delay, Task &&task)
 

Additional Inherited Members

- Public Member Functions inherited from fly::task::TaskRunner
virtual ~TaskRunner ()=default
 
template<typename TaskType >
bool post_task (TaskLocation &&location, TaskType &&task)
 
template<typename OwnerType , typename TaskType >
bool post_task (TaskLocation &&location, std::weak_ptr< OwnerType > weak_owner, TaskType &&task)
 
template<typename TaskType , typename ReplyType >
bool post_task_with_reply (TaskLocation &&location, TaskType &&task, ReplyType &&reply)
 
template<typename OwnerType , typename TaskType , typename ReplyType >
bool post_task_with_reply (TaskLocation &&location, std::weak_ptr< OwnerType > weak_owner, TaskType &&task, ReplyType &&reply)
 
template<typename TaskType >
bool post_task_with_delay (TaskLocation &&location, std::chrono::milliseconds delay, TaskType &&task)
 
template<typename OwnerType , typename TaskType >
bool post_task_with_delay (TaskLocation &&location, std::weak_ptr< OwnerType > weak_owner, std::chrono::milliseconds delay, TaskType &&task)
 
template<typename TaskType , typename ReplyType >
bool post_task_with_delay_and_reply (TaskLocation &&location, std::chrono::milliseconds delay, TaskType &&task, ReplyType &&reply)
 
template<typename OwnerType , typename TaskType , typename ReplyType >
bool post_task_with_delay_and_reply (TaskLocation &&location, std::weak_ptr< OwnerType > weak_owner, std::chrono::milliseconds delay, TaskType &&task, ReplyType &&reply)
 

Detailed Description

Task runner implementation for executing tasks in parallel. Tasks posted to this task runner may be executed in any order.

Author
Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
Version
August 12, 2018

Member Function Documentation

◆ create()

std::shared_ptr< ParallelTaskRunner > fly::task::ParallelTaskRunner::create ( std::shared_ptr< TaskManager task_manager)
static

Create a parallel task runner.

Parameters
task_managerThe task manager this runner should interface with.
Returns
The created task runner.

◆ post_task_internal()

bool fly::task::ParallelTaskRunner::post_task_internal ( TaskLocation &&  location,
Task &&  task 
)
overrideprotectedvirtual

Post a task for execution immediately.

Parameters
locationThe location from which the task was posted.
taskThe task to be executed.
Returns
True if the task was posted for execution.

Implements fly::task::TaskRunner.

◆ task_complete()

void fly::task::ParallelTaskRunner::task_complete ( TaskLocation &&  location)
overrideprotectedvirtual

This implementation does nothing.

Parameters
locationThe location from which the task was posted.

Implements fly::task::TaskRunner.


The documentation for this class was generated from the following files: