Package | com.rosettastone.library.taskmanager |
Class | public class TaskManager |
Inheritance | TaskManager ![]() ![]() ![]() |
Method | Defined By | ||
---|---|---|---|
TaskManager(interruptible:Boolean = false)
Constructor. | TaskManager | ||
Adds a task to the graph and set its dependencies. | TaskManager | ||
![]() |
Executes the specified tasks when the current task is executed. | Task | |
![]() | Task | ||
![]() | interrupt():Boolean [override]
Interruptible tasks should override interrupt() and get interruptible() if they are interruptible. | AbstractTaskManager | |
![]() | interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified. | Task | |
![]() |
Executes the specified tasks if the current task fails. | Task | |
removeTask(taskToRemove:ITask):void
Removes a task from the task manager. | TaskManager | ||
![]() | reset():void
Resets the task to it's pre-run state. | Task | |
![]() |
Starts a task. | Task | |
![]() |
Executes the specified tasks once the current task has completed successfully. | Task | |
![]() | withCompleteHandler(completeHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate completion, this method may also be used for notification purposes. | Task | |
![]() | withErrorHandler(errorHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate failure, this method may also be used for notification purposes. | Task | |
![]() | withFinalHandler(finalHandler:Function):ITask
This handler is invoked upon either success or failure of the Task. | Task | |
![]() | withInterruptionHandler(interruptionHandler:Function):ITask | Task | |
![]() | withStartedHandler(startedHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate starting, this method may also be used for notification purposes. | Task |
TaskManager | () | Constructor |
public function TaskManager(interruptible:Boolean = false)
Constructor.
Parametersinterruptible:Boolean (default = false ) — Consider using InterruptibleTaskManager instead of this parameter.
|
addTask | () | method |
public function addTask(task:ITask, dependencies:Array = null):void
Adds a task to the graph and set its dependencies. If TaskManager is currently running and the specified Taks has invalid dependencies, an ERROR event will be dispatched immediately.
Parameters
task:ITask — Task to add to TaskManager
| |
dependencies:Array (default = null ) — Array of Tasks that newly added Task depends on
|
Error — if TaskManager has been configured for interruptible-mode and Task is not either interruptible or synchronous
|
removeTask | () | method |
public function removeTask(taskToRemove:ITask):void
Removes a task from the task manager. If the TaskManager is running and this operation unblocks any of the remaining Tasks, they will be executed as a result of this removal.
Parameters
taskToRemove:ITask — The task to remove
|
taskManagerEventComplete | Event |
taskManagerEventError | Event |
taskManagerEventInterrupted | Event |