This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-05
Channels
- # aws (6)
- # beginners (10)
- # boot (33)
- # cider (23)
- # cljs-dev (50)
- # cljsjs (2)
- # cljsrn (10)
- # clojars (1)
- # clojure (215)
- # clojure-czech (1)
- # clojure-dev (5)
- # clojure-italy (23)
- # clojure-russia (18)
- # clojure-spec (11)
- # clojure-uk (53)
- # clojurescript (157)
- # core-async (29)
- # cursive (12)
- # data-science (15)
- # datascript (16)
- # datomic (68)
- # graphql (2)
- # jobs (5)
- # jobs-discuss (1)
- # juxt (17)
- # lein-figwheel (2)
- # luminus (3)
- # off-topic (155)
- # om (3)
- # pedestal (1)
- # portkey (1)
- # re-frame (7)
- # reagent (4)
- # ring (3)
- # ring-swagger (2)
- # rum (11)
- # unrepl (11)
- # vim (1)
- # yada (2)
hello everyone, i know JDBC is synchonous and theres nothing to do about it but id like a channel API on top of it..
considering im using JDBC + c3p0
, which has its own threadpool, and id like to receive a channel when doing jdbc/query ["select * from t"])
, should i use async.core/go
or async.core/thread
?
re-sharing this since it’s a weekday- an experimental variation on core.async/thread that attempts to cancel the thread if you close the channel https://gist.github.com/noisesmith/02ee2ee5dcb8c0290bd8004c4c4d36aa
I'm trying to create a pipeline but ever time i put into the channel the last item in the pipeline is being removed. I'm having trouble wrapping my head around where I'm going wrong.
it’s funny that you call this a pipeline, because there’s a built in function called pipeline that does this
you would add your additional logic as a (map f) transducer on the out channel
So it looks like pipeline is taking the place of the go while loop but i'm still not doing something right. My idea is that i can thread a channel through multiple pipelined transducers and then every thing i put on the channel has each transducer applied to it. In practice it seems like each time it's called i loose the last transducer.
that should be (>!! all-in "asdf") if i call that multiple times each time i lose one of the channel-loggers
my guess is you are getting an exception killing your loops, the default behavior for exceptions in go blocks is to print them out to stderr (or maybe stdout)
and each loop introduces effectively a buffer of "one", so the Nth time you run in, the Nth from the last transformers "buffer" becomes full, so no more values flow through it
*Thanks @hiredman and @noisesmith
I'd like to call a function with every value put onto a given channel until the channel closes. Right now I'm doing:
(go-loop []
(when-let [value (<! ch)]
(f value)
(recur)))
Is there an easier way to do that that I'm missing? It seems like a common thing to do.
https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L597-L611