(check-queue q pred)
Returns true if there is at least one item in the queue that satisfies the predicate.
Returns true if there is at least one item in the queue that satisfies the predicate.
(pop-queue q)
Pops off the first item in the queue and returns it.
Pops off the first item in the queue and returns it.
(queue)
(queue init)
A janky custom data structure that acts like a queue and is a ref.
It's really just a vector wrapped in a ref.
Items are popped from the left and pushed onto the right.
A janky custom data structure that acts like a queue and is a ref. It's really just a vector wrapped in a ref. Items are popped from the left and pushed onto the right.
(re-queue q pred & [f])
Finds all items in the queue that satisfy the predicate, and re-queues them onto the end of the queue.
When a second function f
is provided, it is called on each re-queued
element. This can be used e.g. to update the timestamps of queued items.
Finds all items in the queue that satisfy the predicate, and re-queues them onto the end of the queue. When a second function `f` is provided, it is called on each re-queued element. This can be used e.g. to update the timestamps of queued items.
(remove-from-queue q pred)
Removes all items from the queue that satisfy the predicate.
Removes all items from the queue that satisfy the predicate.
(reverse-pop-queue q)
Pops off the LAST item in the queue and returns it.
Pops off the LAST item in the queue and returns it.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close