Packagecom.rosettastone.library.taskmanager
Classpublic class InterruptibleCompositeTask
InheritanceInterruptibleCompositeTask Inheritance AbstractCompositeTask Inheritance Task Inheritance flash.events.EventDispatcher
Implements IInterruptibleTask

Wraps a set of IInterruptibleTask (or ISynchronousTask) and executes them in parallel or serial, as specified by a boolean constructor arg. Interruptable composite task designed to be paused and resumed gracefully and automatically handles interrupting and resuming all child tasks.



Public Properties
 PropertyDefined By
 Inheriteddata : *
[read-only] Optional data parameter passed to the Task complete/error/interruption method.
Task
 InheritederrorDatas : Array
[read-only] Error datas from all inner Tasks that failed during execution.
AbstractCompositeTask
 InheritederroredTasks : Array
[read-only] Tasks that errored during execution.
AbstractCompositeTask
 InheritederrorMessages : Array
[read-only] Unique error messages from all inner Tasks that failed during execution.
AbstractCompositeTask
 Inheritedid : Number
[read-only]
Task
 Inheritedinterruptible : Boolean
[override] [read-only] The current Task can be interrupted.
AbstractCompositeTask
 InheritedinterruptingTask : ITask
[read-only] The Task currently interrupting the composite Task's execution (or NULL if no such Task exists).
Task
 InheritedisComplete : Boolean
[read-only] The current task has successfully completed execution.
Task
 InheritedisErrored : Boolean
[read-only] The current task failed.
Task
 InheritedisInterrupted : Boolean
[read-only]
Task
 InheritedisRunning : Boolean
[read-only] The task is currently running.
Task
 Inheritedmessage : String
[read-only] Optional message parameter passed to the task complete/error/interruption method.
Task
 InheritednumCompletedTasks : int
[read-only] Number of inner Tasks that have successfully completed.
AbstractCompositeTask
 InheritednumInternalOperations : int
[override] [read-only] Number of internal operations conducted by this task.
AbstractCompositeTask
 InheritednumInternalOperationsCompleted : int
[override] [read-only] Number of internal operations that have completed.
AbstractCompositeTask
 InheritednumInternalOperationsPending : int
[read-only] Number of internal operations not yet completed.
Task
 InheritednumPendingTasks : int
[read-only] Number of inner Tasks that have been started and have not yet completed.
AbstractCompositeTask
 InheritednumTasks : int
[read-only] Number of inner Tasks.
AbstractCompositeTask
 InheritednumTimesCompleted : int
[read-only] Number of times this task has completed.
Task
 InheritednumTimesErrored : int
[read-only] Number of times this task has errored.
Task
 InheritednumTimesInterrupted : int
[read-only] Number of times this task has been interrupted.
Task
 InheritednumTimesReset : int
[read-only] Number of times this task has been reset.
Task
 InheritednumTimesStarted : int
[read-only] Number of times this task has been started.
Task
 InheritedpendingTasks : Array
[read-only] Tasks currently in the process of being executed.
AbstractCompositeTask
 Inheritedrunning : Boolean
[read-only] The task is currently running.
Task
 Inheritedsynchronous : Boolean
[override] [read-only] The current task can be executed synchronously.
AbstractCompositeTask
 InheritedtaskIdentifier : String
(Optional) human-readable label for task.
Task
 InheriteduniqueID : Number
[read-only] Unique ID for a task.
Task
Protected Properties
 PropertyDefined By
 Inherited_addTasksBeforeRunInvoked : Boolean
AbstractCompositeTask
 InheritedallTasksAreCompleted : Boolean
[read-only] No incomplete Tasks remain in the queue.
AbstractCompositeTask
 InheritedcurrentSerialTask : ITask
[read-only] References the Task that is currently running (if this CompositeTask has been told to execute in serial).
AbstractCompositeTask
 Inherited_erroredTasks : Array
AbstractCompositeTask
 Inherited_executeTaskInParallel : Boolean
AbstractCompositeTask
 Inherited_flushTaskQueueLock : Boolean
AbstractCompositeTask
 Inherited_interruptedTask : ITask
AbstractCompositeTask
 Inheritedlogger : ILogger
[read-only] Instance of ILogger to be used for any custom Task logging.
Task
 Inherited_taskQueue : Array
AbstractCompositeTask
 Inherited_taskQueueIndex : int
AbstractCompositeTask
Public Methods
 MethodDefined By
  
InterruptibleCompositeTask(tasksOrFunctions:Array = null, executeTaskInParallel:Boolean = true, taskIdentifier:String = null)
Constructor
InterruptibleCompositeTask
 Inherited
addFunction(closure:Function, closureIdentifier:String = null):TaskWithClosure
Adds a function to the queue of Tasks by wrapping it inside of a TaskWithClosure.
AbstractCompositeTask
 Inherited
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.
InterruptibleCompositeTask
  
Adds another task to the internal set that this class will execute.
InterruptibleCompositeTask
 Inherited
and(... chainedTasks):ITask
Executes the specified tasks when the current task is executed.
Task
 Inherited
Task
 Inherited
interrupt():Boolean
[override] Interruptible tasks should override interrupt() and get interruptible() if they are interruptible.
AbstractCompositeTask
 Inherited
interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified.
Task
 Inherited
or(... chainedTasks):ITask
Executes the specified tasks if the current task fails.
Task
 Inherited
Removes a function from the queue of Tasks by locating its corresponding TaskWithClosure.
AbstractCompositeTask
 Inherited
removeMultiple(... tasksOrFunctions):void
Removes multiple Tasks or Functions from the internal set.
AbstractCompositeTask
 Inherited
removeTask(task:ITask):void
Removes a task from the internal set that this class will execute.
AbstractCompositeTask
 Inherited
reset():void
Resets the task to it's pre-run state.
Task
 Inherited
Starts a task.
Task
 Inherited
then(... chainedTasks):ITask
Executes the specified tasks once the current task has completed successfully.
Task
 Inherited
withCompleteHandler(completeHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate completion, this method may also be used for notification purposes.
Task
 Inherited
withErrorHandler(errorHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate failure, this method may also be used for notification purposes.
Task
 Inherited
withFinalHandler(finalHandler:Function):ITask
This handler is invoked upon either success or failure of the Task.
Task
 Inherited
withInterruptionHandler(interruptionHandler:Function):ITask
Task
 Inherited
withStartedHandler(startedHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate starting, this method may also be used for notification purposes.
Task
Protected Methods
 MethodDefined By
 Inherited
Convenience method for adding TaskEvent listeners to a Task.
AbstractCompositeTask
 Inherited
addTaskHelper(task:ITask):void
Adds another task to the internal set that this class will execute.
AbstractCompositeTask
 Inherited
Sub-classes may override this method to J.I.T.
AbstractCompositeTask
 Inherited
AbstractCompositeTask
 Inherited
[override] Override this method to perform any custom reset operations.
AbstractCompositeTask
 Inherited
customRun():void
[override] Override this method to give your Task functionality.
AbstractCompositeTask
 Inherited
Task
 Inherited
flushTaskQueue(forcefullyPreventTaskFromCompleting:Boolean = false):void
Remove all Tasks from the queue.
AbstractCompositeTask
 Inherited
getLoggerString(string:String):String
Returns a string for logging the specified task-state event.
Task
 Inherited
Convenience method for handling a completed Task and executing the next.
AbstractCompositeTask
 Inherited
Override this method to be notified when individual Tasks have successfully completed.
AbstractCompositeTask
 Inherited
Override this method to be notified when individual Tasks are started.
AbstractCompositeTask
 Inherited
Convenience method for removing TaskEvent listeners from a Task.
AbstractCompositeTask
 Inherited
taskComplete(message:String, data:* = null):void
This method should be called upon Task completion.
Task
 Inherited
taskError(message:String, data:* = null):void
This method should be called upon Task failure.
Task
 Inherited
taskInterrupted(message:String, data:* = null):void
Call this method to interrupt the currently running Task.
Task
 Inherited
Task
Events
 Event Summary Defined By
 InheritedTask
 InheritedTask
 InheritedTask
 InheritedTask
 InheritedTask
 InheritedTask
Constructor Detail
InterruptibleCompositeTask()Constructor
public function InterruptibleCompositeTask(tasksOrFunctions:Array = null, executeTaskInParallel:Boolean = true, taskIdentifier:String = null)

Constructor

Parameters
tasksOrFunctions: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)

Throws
Error — if tasksOrFunctions Array contains object that is not either an IInterruptibleTask, ISynchronousTask, or a Function
Method Detail
addSynchronousTask()method
public function addSynchronousTask(task:ISynchronousTask):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:ISynchronousTask

addTask()method 
public function addTask(task:IInterruptibleTask):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:IInterruptibleTask