Docs (4.0.0)
Task scheduling

class AsyncTaskQueue

A class that represents a queue of asynchronous tasks within a Scheduler.

class AsyncTaskQueue

Notes

  • Instances of this class are created using Scheduler.createQueue(), typically accessed from app.scheduler. This allows queues to be managed by the scheduler, replacing and stopping them as needed.

Constructor

Type Members

Static Members

Instance Members

  • name readonlyThe name of this queue.
  • options readonlyThe options that were used to create this queue.
  • errors readonlyA list of all errors that were caught while running tasks in this queue.
  • countThe number of tasks that are currently in this queue.
  • add(f, priority?)Adds a task to be run asynchronously.
  • addOrReplace(handle, f, priority?)Adds a task to be run asynchronously, possibly replacing a task currently in the queue.
  • isPaused()Returns true if the queue is currently paused.
  • pause()Pauses execution of the tasks in this queue.
  • resume()Resumes execution of (pending) tasks in this queue.
  • stop()Stops this queue, cancelling invocation of pending tasks.
  • waitAsync(count?)Waits until the number of pending tasks is equal to or lower than a specified count (or zero).
  • run()Invokes pending tasks synchronously.