This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-24
Channels
- # announcements (10)
- # aws-lambda (9)
- # babashka (14)
- # beginners (166)
- # calva (63)
- # chlorine-clover (4)
- # cider (40)
- # cljs-dev (4)
- # clojure (182)
- # clojure-europe (18)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-spec (17)
- # clojure-uk (55)
- # clojurescript (11)
- # core-async (12)
- # cursive (23)
- # datascript (5)
- # datomic (19)
- # emacs (4)
- # fulcro (46)
- # graalvm (2)
- # hoplon (2)
- # joker (3)
- # juxt (1)
- # keechma (2)
- # leiningen (20)
- # malli (1)
- # meander (7)
- # nrepl (1)
- # off-topic (72)
- # pedestal (6)
- # re-frame (15)
- # reitit (7)
- # shadow-cljs (34)
- # sql (14)
- # testing (14)
- # tools-deps (11)
- # tree-sitter (1)
- # vim (14)
- # xtdb (19)
- # yada (3)
Hi all, please advice, does it make sense to use reduce with the pipeline-blocking?
(async/pipeline-blocking concurrent
output-chan
(reduce
(fn [acc hour]
(let [acc* (disj acc hour)]
(worker hour context)
(if (seq acc*)
acc*
(reduced :done))))
hours)
(async/to-chan hours))
What I want to achieve is to send :done
to output channel when all hours were processedthat is my concern, that reduce may not work 😞
thanks
So a way to use pipeline blocking would be
Create input channel with transducer cat
on it
Create output channel
Create pipeline blocking with transducer (map #(worker % context))
put hours
on the input channel
Then do some sort of take from the output channel <!!
/`<!`/`take!`.
That take will block until the work is finished
interesting... let me try. thanks!
thanks