std.concurrent.queue
->timeunit
added in 3.0
(->timeunit obj)returns the timeunit
(q/->timeunit :ms) => java.util.concurrent.TimeUnit/MILLISECONDS
deque
added in 3.0
(deque)(deque & elements)constructs a blocking deque
(q/deque 1 2 3) => java.util.concurrent.LinkedBlockingDeque
drain
added in 3.0
(drain queue)(drain queue max)(drain queue max target)process-bulk
added in 3.0
(process-bulk f queue maximum)put
added in 3.0
(put queue element)(put queue element timeout)(put queue element timeout timeunit)puts an element at the back
(->> (doto (q/queue) (q/put 1)) (into [])) => 1
put-first
added in 3.0
(put-first queue element)(put-first queue element timeout)(put-first queue element timeout timeunit)puts at the front of the queue
put-last
added in 3.0
(put-last queue element)(put-last queue element timeout)(put-last queue element timeout timeunit)puts at the back of the queue
queue
added in 3.0
(queue)(queue & elements)constructs a blocking queue
(q/queue 1 2 3) => java.util.concurrent.LinkedBlockingQueue
queue:fixed
added in 3.0
(queue:fixed size)constructs a fixed size blocking queue
(type (q/queue:fixed 10)) => java.util.concurrent.ArrayBlockingQueue
queue:limited
added in 3.0
(queue:limited size)constructs a limited queue
(q/queue:limited 10)
remaining-capacity
added in 3.0
(remaining-capacity queue)returns the remaining capacity
(q/remaining-capacity (q/queue)) => 2147483647
(q/remaining-capacity (doto (q/queue:fixed 2) (q/put 1))) => 1
take
added in 3.0
(take queue)(take queue timeout)(take queue timeout timeunit)takes an element from the queue
((juxt q/take #(into [] %)) (q/queue 1 2 3)) => [1 2 3]
take-first
added in 3.0
(take-first queue)(take-first queue timeout)(take-first queue timeout timeunit)takes from the front of the queue
take-last
added in 3.0
(take-last queue)(take-last queue timeout)(take-last queue timeout timeunit)takes from the back of the queue