This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-12
Channels
- # beginners (47)
- # boot (5)
- # bristol-clojurians (1)
- # cider (45)
- # clara (2)
- # cljs-dev (11)
- # cljsrn (47)
- # clojure (169)
- # clojure-brasil (2)
- # clojure-dusseldorf (22)
- # clojure-finland (1)
- # clojure-italy (9)
- # clojure-nl (3)
- # clojure-poland (2)
- # clojure-russia (4)
- # clojure-spec (79)
- # clojure-uk (105)
- # clojurescript (59)
- # core-async (41)
- # cursive (31)
- # datomic (10)
- # devcards (1)
- # duct (6)
- # editors (9)
- # emacs (12)
- # figwheel (1)
- # fulcro (50)
- # java (4)
- # mount (1)
- # off-topic (47)
- # onyx (33)
- # pedestal (1)
- # protorepl (1)
- # re-frame (32)
- # reagent (45)
- # ring-swagger (6)
- # shadow-cljs (100)
- # tools-deps (6)
- # uncomplicate (27)
- # vim (3)
@jgdavey don't know your use case for parallelizing work but I can highly recommend the Claypool library for maximum multithreaded flexibility and speed
@dimovich you only read from the channel once, shouldn't you be reading it repeatedly until it gets closed by the pipeline?
that is, s/reading/taking/g
@noisesmith I thought <!!
will close when there is no more data on the pipeline
it reads a single result
by repeatedly consuming in a loop or go-loop, or using a construct that fills a collection from a channel
probably the simplest thing is (async/into [] c)
the names of the functions sort of lead me to believe they are doing (likely blocking) io, which means you should be using pipeline-blocking or pipeline-async
If you have multiple
blocking operations to put in flight, use pipeline-blocking instead,
If you have multiple asynchronous operations to put in flight, use
pipeline-async instead.
(async/<!! (async/into [] (async/pipeline-blocking 4 out-chan xform in-chan)))
still gives me 8 results
you are taking from the channel return from the call to pipeline-blocking, not the output channel you give to pipeline blocking
This just bit me too; why do pipeline and friends return a channel at all?
@hiredman: I thought I'd checked in the past and it returned the output channel
the fact that you go any number of response from the channel returned from pipeline-blocking instead of just getting a closed suggests some kind of bug in your code somewhere
@noisesmith @hiredman thank you both for helping!
I'm wondering which core.async function I was thinking of, that allowed forwarding data from one chan to another with a transducer, which conveniently returns the destination channel
not pipeline* - none of them actually work that way
right, but sometimes you have a channel that comes from someone else, and you want an xform on it
This just bit me too; why do pipeline and friends return a channel at all?