core.async

close! should deblock putting operations like >!!

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    [org.clojure/clojure "1.5.1"]
    [org.clojure/core.async "0.1.278.0-76b25b-alpha"]

Description

When closing a full or bufferless channel then currently blocked insertions should be deblocked and treated as if they tried to insert the value into a closed channel in the first place. Currently the putting operation blocks forever.

Example:

(defn -main
"I don't do a whole lot ... yet."
[& args]
(let [ch (chan)]
(thread
(Thread/sleep 1000)
(close! ch)
(println "channel closed"))
(>!! ch 42)
(println "never reached")))

Yields only "channel closed" and keeps blocked forever.

Activity

Hide
Alexander Kauer added a comment -

Duplicate of Issue ASYNC-36

Show
Alexander Kauer added a comment - Duplicate of Issue ASYNC-36
Hide
Timothy Baldridge added a comment -

this is a duplicate, but I added a note to the close! doc string to explain the semantics better.

Show
Timothy Baldridge added a comment - this is a duplicate, but I added a note to the close! doc string to explain the semantics better.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: