youyesyet.outqueue

Queue of messages waiting to be sent to the server.

add!

(add! q item)

Add this item to the queue q.

count

(count q)

Return the count of items currently in the queue q.

lock!

(lock! q)

Lock the queue q.

locked?

(locked? q)

True if this queue q is locked, else false.

maybe-process-next

(maybe-process-next q process)

Apply this process, assumed to be a function of one argument, to the next item in the queue q, if the queue is not currently locked; return the value returned by process.

new-queue

(new-queue)(new-queue items)

Create a new queue

peek

(peek q)

Look at the next item which could be removed from the queue q.

queue?

(queue? x)

True if x is a queue, else false.

take!

(take! q)

Return the first item from the queue q, rebind the queue to the remaining items. If the queue is empty return nil.

unlock!

(unlock! q)(unlock! q value)

Unlock the queue q if not value is supplied; if a value is supplied, unlock only if that value is true, otherwise lock.