Package | com.rosettastone.library.taskmanager |
Class | public class CompositeTask |
Inheritance | CompositeTask ![]() ![]() ![]() |
Method | Defined By | ||
---|---|---|---|
CompositeTask(tasksOrFunctions:Array = null, executeTaskInParallel:Boolean = true, taskIdentifier:String = null)
Constructor
| CompositeTask | ||
![]() | addFunction(closure:Function, closureIdentifier:String = null):TaskWithClosure
Adds a function to the queue of Tasks by wrapping it inside of a TaskWithClosure. | AbstractCompositeTask | |
![]() | addMultiple(... tasksOrFunctions):void
Adds multiple Tasks or Functions to the internal set. | AbstractCompositeTask | |
Adds another task to the internal set that this class will execute. | CompositeTask | ||
![]() |
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. | AbstractCompositeTask | |
![]() | 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 | |
![]() | removeFunction(closure:Function):TaskWithClosure
Removes a function from the queue of Tasks by locating its corresponding TaskWithClosure. | AbstractCompositeTask | |
![]() | removeMultiple(... tasksOrFunctions):void
Removes multiple Tasks or Functions from the internal set. | AbstractCompositeTask | |
![]() | removeTask(task:ITask):void
Removes a task from the internal set that this class will execute. | AbstractCompositeTask | |
![]() | 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 |
CompositeTask | () | Constructor |
public function CompositeTask(tasksOrFunctions:Array = null, executeTaskInParallel:Boolean = true, taskIdentifier:String = null)
Constructor
ParameterstasksOrFunctions:Array (default = null ) — Set of Tasks and/or functions to be executed
| |
executeTaskInParallel:Boolean (default = true ) — When TRUE, execute all tasks and report if all succeed (COMPLETE) or not (ERROR)
When FALSE, execute tasks in order. Do not execute subsequent tasks if one fails.
| |
taskIdentifier:String (default = null )
|
Error — if tasksOrFunctions Array contains object that is not a Task or a Function
|
addTask | () | method |
public function addTask(task:ITask):void
Adds another task to the internal set that this class will execute. Additional tasks may be safely at any time (including while the CompositeTask is executing). Tasks are added to the end, so in serial tasks, tasks added later will not be run if an earlier one fails.
Parameters
task:ITask |