Affects Version/s: None
Fix Version/s: None
When a channel is closed, all readers and writers waiting for it, whether on a thread with the !! family of functions or in a go block, should unblock and return nil, as if the channel had been closed in the first place. This is expected since channels are frequently discarded after being closed.
The operator >!! (used as example here) immediately returns, when used on a closed channel, however, if >!! is already waiting for a channel, which is then closed, >!! doesn't unblock.
, stalling the thread indefinitely.
EDIT: The thread/go block can still be unblocked, by taking from the channel, however since close! signifies the end of the lifetime of a channel, subsequent takes on it cannot be considered idiomatic.
This is a problem, since the >!! might be called in a try..catch holding resources and such.
The example also shows, that values can be read from a closed channel (and trigger processing), which might be ok for channel buffers, not so much for pending >!! that have side effects in their continuation.
EDIT Removed example documenting different behavior of threads and go blocks, since subsequent tests turned them out to behave the same.
This was first posted to github https://github.com/clojure/core.async/issues/36
Some discussion already happenend there.
http://dev.clojure.org/jira/browse/ASYNC-31 seems related with regard to the close! semantics of a write.