Generic Function | Package: mp | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## dequeue

Arguments: queue &key wait empty-queue-result whostate

Removes the object at the head of the queued sequence queue, that is, the one that has been queued the longest, and returns that object.

If queue is empty, then the result depends on the values of the wait and empty-queue-result keyword arguments.

- If wait is `nil` (the default), then an error is signaled.
- If wait is a real number, then dequeue waits up to that many seconds for an item to be available from the queue. If an item is retrieved within that time interval, it is returned, otherwise the empty-queue-result value (default `nil`) is returned. A wait value of 0 immediately returns either a retrieved queue element or the empty-queue-result value.
- If wait is a non-real non-`nil` value then the process waits until it can successfully dequeue an object from the queue. In this case the empty-queue-result argument is ignored.

The predefined method is for the `queue` class.

The function queue-empty-p indicates whether the queue is empty or not (but the returned value cannot be depended upon if other processes are operating on the queue).

Interlocks ensure that no entry in the queue will be retrieved by more than one process (once the dequeuing starts, it will complete). If the process does wait, its whostate will be set from the whostate keyword argument, which defaults to the string "dequeue".

See Queues in multiprocessing.htm for more information.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version