Skip to content

Commit

Permalink
fix mult when no taps
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Oct 7, 2013
1 parent 76c274d commit 3f98058
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/clojure/clojure/core/async.clj
Expand Up @@ -632,6 +632,8 @@
i.e. each tap must accept before the next item is distributed. Use
buffering/windowing to prevent slow taps from holding up the mult.
Items received when there are no taps get dropped.
If a tap put throws an exception, it will be removed from the mult."
[ch]
(let [cs (atom {}) ;;ch->close?
Expand Down Expand Up @@ -661,7 +663,8 @@
(swap! dctr dec)
(untap* m c))))
;;wait for all
(<! dchan)
(when (seq chs)
(<! dchan))
(recur)))))
m))

Expand Down Expand Up @@ -810,6 +813,8 @@
i.e. each sub must accept before the next item is distributed. Use
buffering/windowing to prevent slow subs from holding up the pub.
Items received when there are no matching subs get dropped.
Note that if buf-fns are used then each topic is handled
asynchronously, i.e. if a channel is subscribed to more than one
topic it should not expect them to be interleaved identically with
Expand Down

1 comment on commit 3f98058

@lgrapenthin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

Please sign in to comment.