core-async

vlaaad 2023-03-02T14:41:28.678439Z

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

ghadi 2023-03-02T14:41:56.391209Z

a/merge

vlaaad 2023-03-02T14:43:26.606549Z

order is important

vlaaad 2023-03-02T14:43:42.339819Z

I need first everything from ch1, then from ch2 etc

ghadi 2023-03-02T14:45:30.489399Z

a/map identity doesn't give you that though

ghadi 2023-03-02T14:45:49.174389Z

right? maybe I'm misremembering

ghadi 2023-03-02T14:46:26.778939Z

no I remembered correctly

vlaaad 2023-03-02T14:46:28.747969Z

ohhh you are right

ghadi 2023-03-02T14:46:35.334099Z

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

vlaaad 2023-03-02T14:46:45.838929Z

You are right, I can’t use map there

ghadi 2023-03-02T14:46:45.982149Z

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

vlaaad 2023-03-02T14:48:27.970159Z

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

vlaaad 2023-03-02T14:48:34.595359Z

thanks