core.async
https://github.com/clojure/core.async
pipeline による関数の並列化
code:async.clj
(ns foo.core
(:require [clojure.core.async :refer
chan go-loop pipeline onto-chan
)
(def in-ch (chan))
(def out-ch (chan))
(pipeline 2 out-ch (map inc) in-ch) ;; 最大で2多重
(onto-chan in-ch
1 3 5 7 9
)
(go-loop []
(when-let
x (<! out-ch)
(println x)
(recur))
#clojure
#ClojureScript