This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-26
Channels
- # announcements (7)
- # babashka (42)
- # beginners (349)
- # chlorine-clover (9)
- # cider (16)
- # circleci (2)
- # clj-kondo (6)
- # cljs-dev (61)
- # cljsrn (15)
- # clojure (95)
- # clojure-europe (11)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (24)
- # clojurescript (21)
- # conjure (2)
- # core-async (8)
- # cursive (12)
- # datascript (2)
- # emacs (4)
- # exercism (1)
- # figwheel-main (86)
- # fulcro (27)
- # graalvm (4)
- # helix (36)
- # hoplon (3)
- # interop (44)
- # kaocha (6)
- # lein-figwheel (4)
- # malli (7)
- # meander (9)
- # off-topic (95)
- # pathom (33)
- # pedestal (13)
- # re-frame (20)
- # reitit (3)
- # shadow-cljs (102)
- # tools-deps (14)
- # xtdb (16)
Is there any way to stop the processing of this block?
(let [saida (chan)
lojas ["STORE-01" "STORE-02" "STORE-03" "STORE-04"]]
(pipeline-blocking 10
saida
(map #(do
(logger/debug (str "Loja -> " (:servidor %)))
(ls/executar-query-linkedserver db (:servidor %) (slurp "sql/semanal/tempo-backup.sql"))))
(to-chan lojas))
(<!! (a/into [] saida)))
when I have so many "STORE"s, I can´t stop the execution until the end of pipeline-blocking
@fabrao do you know how many items in lojas
is too many? if so, I would change the implementation of to-chan
to a go-loop
with a counter and perform close! on lojas
when the counter reaches your limit
or even just a take n
transducer on the channel
@danboykis lojas
will be around 100
@fabrao how would you know it's too many? If there's a specific maximum count, you can add a (take N)
transducer, if there's a condition you can check via a function call, you can use a take-while
transducer that runs your test