Skip to content
Browse files

fix mult when no taps

  • Loading branch information...
1 parent 76c274d commit 3f98058f168a5e0bec67e662fadc5c13c97b1500 @richhickey richhickey committed Oct 7, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/main/clojure/clojure/core/async.clj
View
7 src/main/clojure/clojure/core/async.clj
@@ -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?
@@ -661,7 +663,8 @@
(swap! dctr dec)
(untap* m c))))
;;wait for all
- (<! dchan)
+ (when (seq chs)
+ (<! dchan))
(recur)))))
m))
@@ -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

1 comment on commit 3f98058

@lgrapenthin

Thanks :)

Please sign in to comment.
Something went wrong with that request. Please try again.