core.async

Pubs fail (in CLJS only) if there are no subscribers for a topic

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

Description

The following code throws "Uncaught Error: No protocol method Mux.muxch* defined for type null":

(def c (async/chan))
(def p (async/pub c :topic))
(async/put! c {:topic :foo})

If a sub is registered for the :foo topic everything works as expected. I suspect the reason is that this line is missing from the CLJS source.

Activity

Jonas Enlund made changes -
Field Original Value New Value
Description The following code throws "Uncaught Error: No protocol method Mux.muxch* defined for type null":

{code}
(def c (async/chan))
(def p (async/pub my-chan :topic))
(async/put! c {:topic :foo})
{code}

If a sub is registered for the :foo topic everything works as expected. I suspect the reason is that [this line|https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L869] is missing from the CLJS source.
The following code throws "Uncaught Error: No protocol method Mux.muxch* defined for type null":

{code}
(def c (async/chan))
(def p (async/pub c :topic))
(async/put! c {:topic :foo})
{code}

If a sub is registered for the :foo topic everything works as expected. I suspect the reason is that [this line|https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L869] is missing from the CLJS source.
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: