Fork me on GitHub
#core-async
<
2023-03-02
>
vlaaad14:03:28

is there a better way to concat channels other than (a/map identity [ch1 ch2 ..]) ?

vlaaad14:03:26

order is important

vlaaad14:03:42

I need first everything from ch1, then from ch2 etc

ghadi14:03:30

a/map identity doesn't give you that though

ghadi14:03:49

right? maybe I'm misremembering

ghadi14:03:26

no I remembered correctly

vlaaad14:03:28

ohhh you are right

ghadi14:03:35

clojure.core.async/map
([f chs] [f chs buf-or-n])
  Takes a function and a collection of source channels, and returns a
  channel which contains the values produced by applying f to the set
  of first items taken from each source channel, followed by applying
  f to the set of second items from each channel, until any one of the
  channels is closed, at which point the output channel will be
  closed. The returned channel will be unbuffered by default, or a
  buf-or-n can be supplied
nil

vlaaad14:03:45

You are right, I can’t use map there

ghadi14:03:45

it won't even work because identity isn't vararg

vlaaad14:03:27

I guess I’ll write a go loop then..