File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/clojure/clojure/core/async/flow Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 108108 nil ))
109109 (async/chan (or buf-or-n 10 ))))
110110 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))))
111114 out-chans (zipmap (keys outopts)
112115 (map (fn [[coord opts :as co]]
113116 (let [conns (conn-map coord)]
114117 (cond
115118 (empty? conns) nil
119+ (needs-mult? coord conns) (make-chan co)
116120 ; ;direct connect 1:1
117- (= 1 (count conns)) (in-chans (first conns))
118- :else (make-chan co))))
121+ :else (in-chans (first conns)))))
119122 outopts))
120123 ; ;mults
121124 _ (doseq [[out ins] conn-map]
122- (when (< 1 ( count ins) )
125+ (when (needs-mult? out ins)
123126 (let [m (async/mult (out-chans out))]
124127 (doseq [in ins]
125128 (async/tap m (in-chans in))))))
You can’t perform that action at this time.
0 commit comments