2024 Clojure 状态调查!中分享您的想法。

欢迎!请参阅关于页面了解有关此信息。

0
core.async

`
(def ch (chan 1 (take 2)))

(put! ch 1)
(put! ch 2)
(put! ch 3)

(take! ch identity)

`

ClassCastException clojure.lang.PersistentVector cannot be cast to java.util.concurrent.locks.Lock clojure.core.async.impl.channels.ManyToManyChannel (channels.clj:55)

如果在此之前进行一次take,以确保缓冲区大小合适,则不会发生这种情况。但问题似乎并不仅与缓冲区大小有关。

`
(def ch (chan 1 (take-while true?)))

(put! ch true)
(put! ch false)
(put! ch false)

(take! ch identity)
`

ClassCastException clojure.lang.PersistentVector cannot be cast to java.util.concurrent.locks.Lock clojure.core.async.impl.channels.ManyToManyChannel (channels.clj:55)

1 答案

0
...