[ASYNC-31] put! does not throw on closed channel Created: 02/Nov/13 Updated: 02/Sep/14 Resolved: 02/Sep/14
The docstring of put! says "Will throw if closed". However, put!-ing to a closed channel appears to succeed, and even calls the supplied callback.
I'm not sure which is incorrect - the behavior or the docstring (or my intepretation of it) - but it does appear that the implementation of mult is expecting an exception from put!, in order to do cleanup.
|Comment by Justin Balthrop [ 10/Feb/14 4:53 PM ]|
The doc string for put! no longer says "Will throw if closed" for clojure.core.async, though it does still say this for cljs.core.async (and doesn't seem to work).
It looks like Rich started switching put! to return true unless the channel is closed in cf8dc1bf207e646c14b2bf44763737fcb5f08c78. The docstring reflects this change, but from my testing, put! still always returns nil.
|Comment by Sung Pae [ 02/Apr/14 3:25 PM ]|
Since this is likely a docstring mismatch, I'd like to add that the docstring for clojure.core.async/put states:
fn1 is passed `false` when the port is closed, not `true`.
|Comment by Alex Miller [ 02/Sep/14 9:39 AM ]|
Docstring addressed with