collect-your-stuff
    Preparing search index...

    Class TaskQueue

    Maintain a series of queued tasks (Queueables): dequeue() takes the next task from the front and RUNS it, giving each task in turn a chance to run (a task which is not ready, or which has not finished, is placed at the back again). This is a task scheduler, for a plain first-in-first-out collection of items use Queue.

    Index
    • Instantiate the queue with the given queue list.

      Parameters

      • queuedList: IsArrayable<any> = null

        Give the list of queueables to start in this queue.

      • listClass: any = LinkedList

        The type of list to create when no queued list is given.

      • queueableClass: typeof Queueable = Queueable

        The class used to wrap queued items.

      Returns TaskQueue

    queuedList: IsArrayable<any>

    The list which stores the queueables, the first is next to be dequeued.

    • Take a queued task from the front of the queue and run it if ready. A task which is not ready yet is kept in the queue (never dropped), a task which is still running is reported as blocking and left to finish on its own, and completed tasks are discarded.

      Returns any

    • Convert an array to a TaskQueue.

      Parameters

      • values: any[] = []

        An array of values which will be converted to queueables in this queue

      • queueableClass: typeof Queueable = Queueable

        The class to use for each queueable

      • listClass: any = LinkedList

        The class to use to manage the queueables

      Returns TaskQueue