(merge chs) (merge chs buf-or-n)
Takes a collection of source channels and returns a channel which contains all values taken from them. The returned channel will be unbuffered by default, or a buf-or-n can be supplied. The channel will close after all the source channels have closed.
user=> (def cx (chan))
#'user/cx
user=> (def cy (chan))
#'user/cy
user=> (def mc (clojure.core.async/merge [cx cy]))
#'user/mc
user=> (put! cx "Going to x")
true
user=> (put! cy "Goint to y")
true
user=> (<!! mc)
"Going to x"
user=> (<!! mc)
"Goint to y"