The JobQueue class implements a priority job queue that runs jobs sequentially.
JobQueue implements a queue that is particularly useful for deferred computation of list display elements,
and can also be used for tasks that need to be done serially.
JobQueue can be either FILO (first in, last out) or FIFO (first in, first out).
The queue ordering: fifo = true -> fifo queuing; fifo = false -> filo queuing
Implementation public function get fifo():Boolean public function set fifo(value:Boolean):void
minExecutionPriority
property
minExecutionPriority:int
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The minimum execution priority. Jobs must have at least this priority to be executed
Implementation public function get minExecutionPriority():int public function set minExecutionPriority(value:int):void
pause
property
pause:Boolean [write-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Pause (or start) the job queue.
Implementation public function set pause(value:Boolean):void
queueName
property
queueName:String [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The queue name.
Implementation public function get queueName():String
Constructor Detail
JobQueue
()
Constructor
public function JobQueue(queueName:String, fifo:Boolean = false, autoStart:Boolean = true, timerInterval:int = 50)
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Constructor.
Parameters
queueName:String — Optional descriptive name of the queue
fifo:Boolean (default = false) — Optional boolean to control fifo behavior (true for fifo, false for filo)
autoStart:Boolean (default = true) — Optional boolean to control job start behavior -
set to true to have JobQueue automatically start the next job in the queue.
Using autoStart == true is generally not a good idea for asynchronous jobs.
timerInterval:int (default = 50) — Time in msec before the next job is begun (after completion of a previous job).
Method Detail
getJob
()
method
public function getJob(jobKey:Object):Object
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the job associated with the specified job key.
Parameters
jobKey:Object
Returns
Object — The job associated with the specified job key.
getJobKey
()
method
public function getJobKey():Object
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Return the key of the next job to be executed.
Returns
Object — The key of the next job to be executed.
hasJobs
()
method
public function hasJobs():Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Whether the queue has pending jobs.
Returns
Boolean — True if the queue has pending jobs.
jobSort
()
method
protected function jobSort():SortReturns
Sort
killAllJobs
()
method
public function killAllJobs():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Kills all pending jobs.
pushJob
()
method
public function pushJob(jobKey:Object, job:Object, callBack:Function, jobPriority:int = 0):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Push a job onto the queue.
Parameters
jobKey:Object — A unique key for the job.
job:Object — An object that generally contains the parameters of the job
callBack:Function — A function that is called to "execute" the job. It takes the form:
callback(jobKey:Object, job:Object):void
jobPriority:int (default = 0) — The priority of the job. The fifo property dictates the order of execution for
all jobs with the same priority. Jobs with a higher priority get executed before jobs
with a lower priority.
If a job is pushed onto the queue with a key that matches an existing job in the queue, then
the new job takes it's place, and the old job is discarded.