The IDLAsyncQueue class manages a collection of IDLAsyncJob objects that are to be executed at some point in the future. It holds the jobs in a list to guarantee order of execution, but it implies no other constraints on which jobs can or cannot be executed concurrently. This class will keep the job objects from being garbage collected by holding ObjRefs to them, at least until they are complete. Once a job is completed, this object forgets about it, so an external ObjRef to the job is needed to prevent it from being garbage collected.

Superclasses


Syntax


Result = IDLAsyncQueue( [CONCURRENCY=Value])

Arguments


None

Keywords


CONCURRENCY (optional)

Specify the initial value of the CONCURRENCY property. The default value is 1 if not set.

Methods


Properties


CONCURRENCY (Init, Get, Set)

The number of queued jobs that are allowed to run concurrently at any point in time. Note that if this property value is changed to a smaller value, the number of concurrent jobs at that point in time may exceed the new value for this property. However, no new jobs will be executed until this concurrency constraint is satisfied.

IDLAsyncQueue::OnJobDone


The IDLAsyncQueue::OnJobDone method is a callback invoked by any job executed by this queue when it finishes its execution. After this job has been removed, the IDLAsyncQueue will check if there are any available concurrency slots in which to execute any queued jobs.

Syntax


IDLAsyncQueue.OnJobDone, Job

Arguments


Job

An IDLAsyncJob object that has completed execution and can be removed from the list of running jobs. If the job is unknown to this queue, it will be ignored.

Keywords


None

IDLAsyncQueue::RunningCount


The IDLAsyncQueue::RunningCount method returns the number of jobs that have been queued and are currently executing.

Syntax


Result = IDLAsyncQueue.RunningCount()

Arguments


None

Keywords


None

IDLAsyncQueue::SubmitJob


The IDLAsyncQueue::SubmitJob method adds one or more IDLAsyncJob objects to the internal queue to be executed when resources are ready in the future. After the job(s) are queued, the IDLAsyncQueue will check if there are any available concurrency slots in which to execute any jobs.

Syntax


IDLAsyncQueue.SubmitJob, Job

Arguments


Job

One or more IDLAsyncJob objects to be queued for future execution. If any of these jobs has already been queued for execution, an error will be issued.

Keywords


None

IDLAsyncQueue::WaitingCount


The IDLAsyncQueue::WaitingCount method returns the number of jobs in the queue awaiting execution.

Syntax


Result = IDLAsyncQueue.WaitingCount()

Arguments


None

Keywords


None

Version History


8.7

Introduced

See Also


IDLAsyncJob