modal
    Preparing search index...

    Class Queue

    Distributed, FIFO queue for data flow in Modal apps.

    Index

    Properties

    queueId: string

    Methods

    • Delete the ephemeral queue. Only usable with Queue.ephemeral().

      Returns void

    • Remove and return the next object from the queue.

      By default, this will wait until at least one item is present in the queue. If timeout is set, raises QueueEmptyError if no items are available within that timeout in milliseconds.

      Parameters

      Returns Promise<any>

    • Remove and return up to n objects from the queue.

      By default, this will wait until at least one item is present in the queue. If timeout is set, raises QueueEmptyError if no items are available within that timeout in milliseconds.

      Parameters

      Returns Promise<any[]>

    • Add an item to the end of the queue.

      If the queue is full, this will retry with exponential backoff until the provided timeout is reached, or indefinitely if timeout is not set. Raises QueueFullError if the queue is still full after the timeout.

      Parameters

      Returns Promise<void>

    • Add several items to the end of the queue.

      If the queue is full, this will retry with exponential backoff until the provided timeout is reached, or indefinitely if timeout is not set. Raises QueueFullError if the queue is still full after the timeout.

      Parameters

      Returns Promise<void>