Package | com.rosettastone.library.taskmanager |
Interface | public interface IInterruptibleTask extends ITask, flash.events.IEventDispatcher |
Implementors | InterruptibleCompositeTask, InterruptibleTask, InterruptibleTaskManager, SynchronousTask, SynchronousTaskWithClosure |
Property | Defined By | ||
---|---|---|---|
![]() | data : * [read-only]
Optional data parameter passed to the Task complete/error/interruption method. | ITask | |
interruptingTask : ITask [read-only]
The Task currently interrupting the this Task's execution (or NULL if no such Task exists). | IInterruptibleTask | ||
![]() | isComplete : Boolean [read-only]
The current task has successfully completed execution. | ITask | |
![]() | isErrored : Boolean [read-only]
The current task failed. | ITask | |
isInterrupted : Boolean [read-only]
The task has been interrupted and has not yet resumed. | IInterruptibleTask | ||
![]() | isRunning : Boolean [read-only]
The task is currently running. | ITask | |
![]() | message : String [read-only]
Optional message parameter passed to the task complete/error/interruption method. | ITask | |
![]() | numInternalOperations : int [read-only]
Number of internal operations conducted by this task. | ITask | |
![]() | numInternalOperationsCompleted : int [read-only]
Number of internal operations that have completed. | ITask | |
![]() | numInternalOperationsPending : int [read-only]
Number of internal operations not yet completed. | ITask | |
![]() | numTimesCompleted : int [read-only]
Number of times this task has completed. | ITask | |
![]() | numTimesErrored : int [read-only]
Number of times this task has errored. | ITask | |
![]() | numTimesInterrupted : int [read-only]
Number of times this task has been interrupted. | ITask | |
![]() | numTimesReset : int [read-only]
Number of times this task has been reset. | ITask | |
![]() | numTimesStarted : int [read-only]
Number of times this task has been started. | ITask | |
![]() | running : Boolean [read-only]
The task is currently running. | ITask | |
![]() | synchronous : Boolean [read-only]
The current task can be executed synchronously. | ITask | |
![]() | taskIdentifier : String
(Optional) human-readable label for task. | ITask | |
![]() | uniqueID : Number [read-only]
Unique ID for a task. | ITask |
Method | Defined By | ||
---|---|---|---|
![]() |
Executes the specified tasks when the current task is executed. | ITask | |
If an interrupting-Task has been provided (via interruptForTask) this Task will automatically resume when it completes. | IInterruptibleTask | ||
interrupt():Boolean
Interrupt the current Task. | IInterruptibleTask | ||
interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified. | IInterruptibleTask | ||
![]() |
Executes the specified tasks if the current task fails. | ITask | |
![]() | reset():void
Resets the task to it's pre-run state. | ITask | |
![]() |
Starts a task. | ITask | |
![]() |
Executes the specified tasks once the current task has completed successfully. | ITask | |
![]() | withCompleteHandler(completeHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate completion, this method may also be used for notification purposes. | ITask | |
![]() | withErrorHandler(errorHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate failure, this method may also be used for notification purposes. | ITask | |
![]() | withFinalHandler(finalHandler:Function):ITask
This handler is invoked upon either success or failure of the Task. | ITask | |
withInterruptionHandler(interruptionHandler:Function):ITask
Although Tasks dispatch TaskEvents to indicate interruption this method may also be used for notification purposes. | IInterruptibleTask | ||
![]() | withStartedHandler(startedHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate starting, this method may also be used for notification purposes. | ITask |
Event | Summary | Defined By | ||
---|---|---|---|---|
IInterruptibleTask |
interruptingTask | property |
interruptingTask:ITask
[read-only] The Task currently interrupting the this Task's execution (or NULL if no such Task exists).
public function get interruptingTask():ITask
isInterrupted | property |
isInterrupted:Boolean
[read-only] The task has been interrupted and has not yet resumed.
public function get isInterrupted():Boolean
disconnectFromInterruptingTask | () | method |
public function disconnectFromInterruptingTask():void
If an interrupting-Task has been provided (via interruptForTask) this Task will automatically resume when it completes. This method to cancels that behavior by removing references and event listeners.
interrupt | () | method |
public function interrupt():Boolean
Interrupt the current Task. Interruptions should be handled in such a way as to allow a subsequent call to run() to resume gracefully. This mehtod should trigger an event of type TaskEvent.INTERRUPTED.
ReturnsBoolean — TRUE if the Task has been successfully interrupted
|
interruptForTask | () | method |
public function interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified. Once this Task dispatches a TaskEvent.COMPLETE event, this Task will resume. If the specified Task dispatches a TaskEvent.ERROR event this Task will also error. TaskEvent.INTERRUPTED events are ignored. If this method is called once with a Task and then called again before that Task has completed, Event listeners will be removed from the first Task and added to the second one. There can only be 1 active interrupting Task at a time. If this Task should be interrupted by more than one Task, a CompositeTask or ObserverTask should be used. If the specified interrupting Task is already running this method will simply add event listeners. If it is not running this method will add event listeners but will rely on external code to run the interrupter.
Parameters
interruptingTask:ITask — Task
|
Boolean — TRUE if the Task has been successfully interrupted
|
withInterruptionHandler | () | method |
public function withInterruptionHandler(interruptionHandler:Function):ITask
Although Tasks dispatch TaskEvents to indicate interruption this method may also be used for notification purposes. The provided function will be invoked only upon interruption of the Task. This method may be called multiple times safely; each unique function specified will be executed once if the task interrupts.
It should have one of the following signatures:
function( message:String = "", data:= null ):void
function():void
Parameters
interruptionHandler:Function — Function
|
ITask |
taskEventInterrupted | Event |