core.async

alts!! not working on a channel which is subscribed to a pub-channel

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojure 1.6.0, core.async 0.1.303.0-886421-alpha

Description

Error message: Exception in thread "main" java.lang.UnsupportedOperationException: count not supported on this type: ManyToManyChannel

Minimal failing case:

(require '[clojure.core.async :refer (chan pub sub put! alts!!)])
(def out (chan))
(def publisher (pub out #(:topic %)))
(def s (chan))
(sub publisher :1 s)

(put! out {:topic :1 :content "Yes!"})
(alts!! s :default "Oh no.")

Activity

Hide
Alex Miller added a comment -

Your use of alts!! has a bug - the ports passed to it is expected to be a vector, not a single operation:

(alts!! [s] :default "Oh no.")

Show
Alex Miller added a comment - Your use of alts!! has a bug - the ports passed to it is expected to be a vector, not a single operation: (alts!! [s] :default "Oh no.")

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: