(bounded? queue)(dequeue! queue)Removes and returns the next item from the queue, or nil when empty.
Removes and returns the next item from the queue, or nil when empty.
(enqueue! queue item)Offers item to queue without blocking. Returns true when accepted.
On a BOUNDED queue a false return means the queue is full -- the caller is responsible for deciding whether to retry, block, or shed load. Never assume the item was stored.
Offers `item` to `queue` without blocking. Returns true when accepted. On a BOUNDED queue a false return means the queue is full -- the caller is responsible for deciding whether to retry, block, or shed load. Never assume the item was stored.
(enqueue-blocking! queue item timeout-ms)Offers item to queue, waiting up to timeout-ms for capacity.
Returns true when stored, false on timeout. Use this where dropping a message
would be data loss and waiting is an acceptable backpressure signal.
Offers `item` to `queue`, waiting up to `timeout-ms` for capacity. Returns true when stored, false on timeout. Use this where dropping a message would be data loss and waiting is an acceptable backpressure signal.
(get-or-create-queue! queues topic)Returns the queue for topic, creating it if missing.
Returns the queue for `topic`, creating it if missing.
(get-queue queues topic)(get-queue! queues topic)(known-topics queues)(make-queue)(make-queue capacity)Creates a BlockingQueue. With a positive capacity the queue is bounded and
enqueue! will start returning false once full -- the signal producers must
use to apply backpressure.
Creates a BlockingQueue. With a positive `capacity` the queue is bounded and `enqueue!` will start returning false once full -- the signal producers must use to apply backpressure.
(peek queue)Returns the next item without removing it, or nil when empty.
Returns the next item without removing it, or nil when empty.
(poll! queue timeout-ms)Removes and returns the next item from the queue, waiting up to timeout-ms ms if empty.
Returns nil if timeout expires without an item.
Removes and returns the next item from the queue, waiting up to `timeout-ms` ms if empty. Returns nil if timeout expires without an item.
(remaining-capacity queue)How many more items queue accepts without blocking. Integer/MAX_VALUE for
unbounded queues. Producers should consult this before fetching a batch.
How many more items `queue` accepts without blocking. `Integer/MAX_VALUE` for unbounded queues. Producers should consult this before fetching a batch.
(size queue)(take! queue)Removes and returns the next item from the queue, blocking indefinitely until available.
Removes and returns the next item from the queue, blocking indefinitely until available.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |