File tree 1 file changed +6
-3
lines changed
src/main/clojure/clojure/core/async/flow
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 108
108
nil ))
109
109
(async/chan (or buf-or-n 10 ))))
110
110
in-chans (zipmap (keys inopts) (map make-chan inopts))
111
+ needs-mult? (fn [out ins]
112
+ (or (< 1 (count ins))
113
+ (= (first out) (ffirst ins))))
111
114
out-chans (zipmap (keys outopts)
112
115
(map (fn [[coord opts :as co]]
113
116
(let [conns (conn-map coord)]
114
117
(cond
115
118
(empty? conns) nil
119
+ (needs-mult? coord conns) (make-chan co)
116
120
; ;direct connect 1:1
117
- (= 1 (count conns)) (in-chans (first conns))
118
- :else (make-chan co))))
121
+ :else (in-chans (first conns)))))
119
122
outopts))
120
123
; ;mults
121
124
_ (doseq [[out ins] conn-map]
122
- (when (< 1 ( count ins) )
125
+ (when (needs-mult? out ins)
123
126
(let [m (async/mult (out-chans out))]
124
127
(doseq [in ins]
125
128
(async/tap m (in-chans in))))))
You can’t perform that action at this time.
0 commit comments