MB
Size: a a a
MB
MB
MB
ST
MB
ST
MB
ST
(->> messages
(mapv #(future (send-message %)))
(mapv deref))
MB
ST
ST
core.async/pipeline
с контролируемым параллелизмомMB
ST
core.async/pipeline
с контролируемым параллелизмом(time (let [from (->> (list 1 2 3) (async/to-chan!))
to (async/chan)
xf (map #(deref (future (Thread/sleep 1000) %)))]
(async/pipeline-blocking 10 to xf from true)
(async/<!! (async/into [] to))))
"Elapsed time: 1007.2854 msecs"
=> [1 2 3]
ST
(time (let [from (->> (list 1 2 3) (async/to-chan!))
to (async/chan)
xf (map #(deref (future (Thread/sleep 1000) %)))]
(async/pipeline-blocking 10 to xf from true)
(async/<!! (async/into [] to))))
"Elapsed time: 1007.2854 msecs"
=> [1 2 3]
ST
MB
MB
AC
AC
MB