| Package | com.rosettastone.library.taskmanager |
| Class | public class ObserverTask |
| Inheritance | ObserverTask Task flash.events.EventDispatcher |
| Property | Defined By | ||
|---|---|---|---|
![]() | data : * [read-only]
Optional data parameter passed to the Task complete/error/interruption method. | Task | |
![]() | id : Number [read-only]
| Task | |
![]() | interruptible : Boolean [read-only]
The current Task can be interrupted. | Task | |
![]() | interruptingTask : ITask [read-only]
The Task currently interrupting the composite Task's execution (or NULL if no such Task exists). | Task | |
![]() | isComplete : Boolean [read-only]
The current task has successfully completed execution. | Task | |
![]() | isErrored : Boolean [read-only]
The current task failed. | Task | |
![]() | isInterrupted : Boolean [read-only]
| Task | |
![]() | isRunning : Boolean [read-only]
The task is currently running. | Task | |
![]() | message : String [read-only]
Optional message parameter passed to the task complete/error/interruption method. | Task | |
| numInternalOperations : int [override] [read-only]
Number of internal operations conducted by this task. | ObserverTask | ||
| numInternalOperationsCompleted : int [override] [read-only]
Number of internal operations that have completed. | ObserverTask | ||
![]() | numInternalOperationsPending : int [read-only]
Number of internal operations not yet completed. | Task | |
![]() | numTimesCompleted : int [read-only]
Number of times this task has completed. | Task | |
![]() | numTimesErrored : int [read-only]
Number of times this task has errored. | Task | |
![]() | numTimesInterrupted : int [read-only]
Number of times this task has been interrupted. | Task | |
![]() | numTimesReset : int [read-only]
Number of times this task has been reset. | Task | |
![]() | numTimesStarted : int [read-only]
Number of times this task has been started. | Task | |
![]() | running : Boolean [read-only]
The task is currently running. | Task | |
![]() | synchronous : Boolean [read-only]
The current task can be executed synchronously. | Task | |
![]() | taskIdentifier : String
(Optional) human-readable label for task. | Task | |
![]() | uniqueID : Number [read-only]
Unique ID for a task. | Task | |
| Property | Defined By | ||
|---|---|---|---|
| _failUponError : Boolean | ObserverTask | ||
![]() | logger : ILogger [read-only]
Instance of ILogger to be used for any custom Task logging. | Task | |
| _observedTasks : Array | ObserverTask | ||
| Method | Defined By | ||
|---|---|---|---|
ObserverTask(tasks:Array = null, failUponError:Boolean = true, taskIdentifier:String = null)
Constructor. | ObserverTask | ||
![]() |
Executes the specified tasks when the current task is executed. | Task | |
![]() | Task | ||
![]() | interrupt():Boolean
Interruptible tasks should override interrupt() and get interruptible() if they are interruptible. | Task | |
![]() | interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified. | Task | |
observeTask(taskToObserve:ITask):void
Add an additional Task to the set of Tasks being observed. | ObserverTask | ||
![]() |
Executes the specified tasks if the current task fails. | Task | |
![]() | reset():void
Resets the task to it's pre-run state. | Task | |
![]() |
Starts a task. | Task | |
stopObservingTask(taskToObserve:ITask):void
Remove the specified Task from the set of Tasks being observed. | ObserverTask | ||
![]() |
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 | |
| Method | Defined By | ||
|---|---|---|---|
areAllObservedTasksCompletedOrErrored():Boolean | ObserverTask | ||
checkForAndHandleCompletion():void | ObserverTask | ||
![]() | customReset():void
Override this method to perform any custom reset operations. | Task | |
customRun():void [override]
Override this method to give your Task functionality. | ObserverTask | ||
![]() | dispatchProgressEvent():void | Task | |
![]() | getLoggerString(string:String):String
Returns a string for logging the specified task-state event. | Task | |
![]() | taskComplete(message:String, data:* = null):void
This method should be called upon Task completion. | Task | |
![]() | taskError(message:String, data:* = null):void
This method should be called upon Task failure. | Task | |
![]() | taskInterrupted(message:String, data:* = null):void
Call this method to interrupt the currently running Task. | Task | |
![]() | throwErrorIfAnyObjectInArrayIsNotATask(tasks:Array):void | Task | |
| _failUponError | property |
protected var _failUponError:Boolean| _observedTasks | property |
protected var _observedTasks:Array| numInternalOperations | property |
numInternalOperations:int [read-only] [override] Number of internal operations conducted by this task. Sub-classes should override this method if containing a value > 1; If value > 1, task should dispatch ProgressEvent.PROGRESS events manually to indicate changes in numInternalOperationsCompleted. If value == 1, task will automatically dispatching ProgressEvent.PROGRESS events.
public function get numInternalOperations():int| numInternalOperationsCompleted | property |
numInternalOperationsCompleted:int [read-only] [override] Number of internal operations that have completed. Sub-classes should override this method if containing a value > 1;
public function get numInternalOperationsCompleted():int| observedTasks | property |
observedTasks:Array [read-only] Array of Tasks currently observed by this Task.
TaskPrivateNamespace function get observedTasks():Array| ObserverTask | () | Constructor |
public function ObserverTask(tasks:Array = null, failUponError:Boolean = true, taskIdentifier:String = null)Constructor.
Parameterstasks:Array (default = null) — Array of Tasks to observe
| |
failUponError:Boolean (default = true) — Controls behavior in the event of a Task error; see class documentation for more detail
| |
taskIdentifier:String (default = null) |
| areAllObservedTasksCompletedOrErrored | () | method |
protected function areAllObservedTasksCompletedOrErrored():BooleanReturnsBoolean |
| checkForAndHandleCompletion | () | method |
protected function checkForAndHandleCompletion():void| customRun | () | method |
override protected function customRun():voidOverride this method to give your Task functionality.
| observeTask | () | method |
public function observeTask(taskToObserve:ITask):voidAdd an additional Task to the set of Tasks being observed.
Parameters
taskToObserve:ITask |
| stopObservingTask | () | method |
public function stopObservingTask(taskToObserve:ITask):voidRemove the specified Task from the set of Tasks being observed.
Parameters
taskToObserve:ITask |