We're updating the issue view to help you get more done. 

seque broken for some BlockingQueues

Description

clojure.core/seque takes an optional argument that can be the initial capacity for a LinkedBlockingQueue or an instance of the BlockingQueue interface.

PriorityBlockingQueue is such a class, but fails to work because seque makes a few assumptions about BlockingQueues that are not true for all BlockingQueues.

user=> (def s (seque (java.util.concurrent.PriorityBlockingQueue. 100) (shuffle (range 100))))
#'user/s
user=> s
java.lang.NullPointerException

user=> (seque (java.util.concurrent.SynchronousQueue.) (shuffle (range 100)))
<never finishes>

user=> (seque (java.util.concurrent.ArrayBlockingQueue. 10) (shuffle (range 100)))
(39 41 27 76 1 24 92 34 72 37 67 99 38 21 5 64 9 26 59 43 82 65 3 11 31 93 50 63 15 90 13 75 40 97 57 88 86 53 19 83 2 12 54 49 71 28 68 73 96 44 8 98 61 6 22 25 78 66 32 84 60 94 70 7 89 4 33 55 74 81 51 56 62 87 69 80 77 20 30 91 52 10 48 18 36 58 47 14 16 42 35 17 95 0 45 85 29 23 46 79)

Environment

None

Status

Assignee

Unassigned

Reporter

Pepijn de Vos

Labels

None

Approval

None

Patch

None

Priority

Minor