GODPAPER | All Packages | All Classes | Index | Frames No Frames |
ConcurrentTaskGroup

Package | org.spicefactory.lib.task
Class | public class ConcurrentTaskGroup
Inheritance | ConcurrentTaskGroup TaskGroup Task flash.events.EventDispatcher

A TaskGroup implementation that executes its child Tasks concurrently. If a TaskGroup is started all the Tasks that were added to it will be started immediately. If a Taks gets added to a running TaskGroup, that Task will be started immediately. When all child Tasks have completed their operation this TaskGroup will fire its `COMPLETE` event. If a TaskGroup gets cancelled or suspended all child tasks that are still running will also be cancelled or suspended in turn. If a child Task throws an `ERROR` event and the `ignoreChildErrors` property of this TaskGroup is set to false, then all child tasks that are still running will be cancelled and the TaskGroup will fire an `ERROR` event.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | autoStart : Boolean Indicates whether this TaskGroup starts automatically when the first child is added. | TaskGroup
|  | cancelable : Boolean [read-only] Indicates whether this Task can be cancelled. | Task
|  | data : * An arbitrary value associated with this Task. | Task
|  | ignoreChildErrors : Boolean Indicates whether ERROR events of child tasks should be ignored or if they should stop the whole group. | TaskGroup
|  | parent : TaskGroup [read-only] The parent of this Task. | Task
|  | restartable : Boolean [read-only] Indicates whether this Task can be restarted. | Task
|  | root : Task [read-only] The root TaskGroup in case this Task is nested in one or more TaskGroups. | Task
|  | size : uint [read-only] The number of tasks added to this TaskGroup. | TaskGroup
|  | skippable : Boolean [read-only] Indicates whether this Task can be forced to skip to its final state. | Task
|  | state : TaskState [read-only] The current state of this Task. | Task
|  | suspendable : Boolean [read-only] Indicates whether this Task can be suspended. | Task
|  | timeout : uint | TaskGroup

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | ConcurrentTaskGroup(name:String = null) Creates a new TaskGroup. | ConcurrentTaskGroup
|  | addTask(task:Task):Boolean Adds the specified task to this TaskGroup. | TaskGroup
|  | cancel():Boolean Cancels this Task. | Task
|  | getTask(index:uint):Task Returns the Task at the specified index. | TaskGroup
|  | removeAllTasks():void Removes all tasks from this TaskGroup. | TaskGroup
|  | removeTask(task:Task):Boolean Removes the specified task from this TaskGroup. | TaskGroup
|  | resume():Boolean Resumes this Task if it is suspended. | Task
|  | skip():Boolean Forces this Task to move to its final state. | Task
|  | start():Boolean Starts this Task. | Task
|  | suspend():Boolean Suspends this Task. | Task

Protected Methods
Show Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | complete():Boolean Signals that this Task has completed. | Task
|  | doCancel():void Called before the CANCEL event gets fired. | Task
|  | doError(message:String):void Called before the ERROR event gets fired. | Task
|  | doResume():void Called before the RESUME event gets fired. | Task
|  | doSkip():void Called after skip has been called but before the COMPLETE event gets fired. | Task
|  | doStart():void Called before the START event gets fired. | Task
|  | doSuspend():void Called before the SUSPEND event gets fired. | Task
|  | doTimeout():void Called before the ERROR event gets fired after a timeout occurred. | Task
|  | error(message:String):Boolean Signals an error condition and cancels the Task. | Task
|  | handleAddedTask(t:Task):void Method hook for subclasses that gets called when a child Task was added to this TaskGroup. | TaskGroup
|  | handleRemoveAll():void Method hook for subclasses that gets called when all child tasks have been removed from this TaskGroup. | TaskGroup
|  | handleRemovedTask(task:Task, index:uint):void Method hook for subclasses that gets called when a child Task was removed from this TaskGroup. | TaskGroup
|  | handleTaskComplete(task:Task):void Method hook for subclasses that gets called when a child Task has completed its operation. | TaskGroup
|  | setCancelable(value:Boolean):void Specifies whether this Task can be cancelled. | Task
|  | setName(name:String):void Sets the name of this Task. | Task
|  | setRestartable(value:Boolean):void Specifies whether this Task can be restarted. | Task
|  | setSkippable(value:Boolean):void Specifies whether this Task can be forced to skip to its final state. | Task
|  | setSuspendable(value:Boolean):void Specifies whether this Task can be suspended. | Task
|  | setTimeout(value:uint):void Sets the timeout for this Task in milliseconds. | Task
|  | startTask(task:Task):void Starts the specified child Task. | TaskGroup

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | cancel | Dispatched when a Task is cancelled. | Task
|  | complete | Dispatched when a Task has completed its execution. | Task
|  | error | Dispatched when a Task has aborted due to an error condition. | Task
|  | resume | Dispatched when a suspended Task is resumed. | Task
|  | start | Dispatched when a Task is started. | Task
|  | suspend | Dispatched when a Task is suspended. | Task

Constructor Detail

ConcurrentTaskGroup | () | Constructor

`public function ConcurrentTaskGroup(name:String = null)`

Creates a new TaskGroup.

Parameters

| `name:String` (default = `null`)`` — an optional name for log output

Thu Jan 16 2014, 01:11 PM +08:00