考虑以下代码片段:
请看下面的代码:
(let [chs (repeatedly 10 chan)]
(doseq [c chs]
(>!! c "hello"))
(doseq [c chs]
(println (<!! c))))
执行这个会一直卡住,这是为什么呢?
如果我改成 (go (>! c "hello"))
,它就能正常工作。
(put! c)
和(go (>! c))
相等吗? - Mark