A Task Runner that can contain one or more CompositeTasks that are each checked for pending work and run if any is present in the order that the tasks were added.
More...
#include <src/main/activemq/threads/CompositeTaskRunner.h>
Protected Member Functions |
virtual void | run () |
| Run method - called by the Thread class in the context of the thread.
|
virtual bool | iterate () |
| Perform one iteration of work, returns true if the task needs to run again to complete or false to indicate that the task is now complete.
|
Detailed Description
A Task Runner that can contain one or more CompositeTasks that are each checked for pending work and run if any is present in the order that the tasks were added.
- Since
- 3.0
Constructor & Destructor Documentation
activemq::threads::CompositeTaskRunner::CompositeTaskRunner |
( |
| ) |
|
virtual activemq::threads::CompositeTaskRunner::~CompositeTaskRunner |
( |
| ) |
|
|
virtual |
Member Function Documentation
void activemq::threads::CompositeTaskRunner::addTask |
( |
CompositeTask * |
task | ) |
|
Adds a new CompositeTask to the Set of Tasks that this class manages.
- Parameters
-
virtual bool activemq::threads::CompositeTaskRunner::isStarted |
( |
| ) |
const |
|
virtual |
virtual bool activemq::threads::CompositeTaskRunner::iterate |
( |
| ) |
|
|
protectedvirtual |
Perform one iteration of work, returns true if the task needs to run again to complete or false to indicate that the task is now complete.
- Returns
- true if the task should be run again or false if the task has completed and the runner should wait for a wakeup call.
Implements activemq::threads::Task.
void activemq::threads::CompositeTaskRunner::removeTask |
( |
CompositeTask * |
task | ) |
|
virtual void activemq::threads::CompositeTaskRunner::run |
( |
| ) |
|
|
protectedvirtual |
virtual void activemq::threads::CompositeTaskRunner::shutdown |
( |
long long |
timeout | ) |
|
|
virtual |
Shutdown after a timeout, does not guarantee that the task's iterate method has completed and the thread halted.
- Parameters
-
timeout | - Time in Milliseconds to wait for the task to stop. |
Implements activemq::threads::TaskRunner.
virtual void activemq::threads::CompositeTaskRunner::shutdown |
( |
| ) |
|
|
virtual |
virtual void activemq::threads::CompositeTaskRunner::start |
( |
| ) |
|
|
virtual |
Starts the task runner.
Prior to call this method tasks can be added to a Runner, but no executions will occur. The start method will create the background Thread(s) which do the work for this task runner.
Implements activemq::threads::TaskRunner.
virtual void activemq::threads::CompositeTaskRunner::wakeup |
( |
| ) |
|
|
virtual |
Signal the TaskRunner to wakeup and execute another iteration cycle on the task, the Task instance will be run until its iterate method has returned false indicating it is done.
Implements activemq::threads::TaskRunner.
The documentation for this class was generated from the following file: