This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-22
Channels
- # beginners (143)
- # boot (18)
- # chestnut (5)
- # clara (1)
- # cljs-experience (1)
- # cljsrn (13)
- # clojure (290)
- # clojure-austin (4)
- # clojure-italy (13)
- # clojure-nl (21)
- # clojure-russia (14)
- # clojure-spec (49)
- # clojure-uk (59)
- # clojurebridge (7)
- # clojurescript (54)
- # core-logic (2)
- # cursive (22)
- # datomic (149)
- # fulcro (31)
- # graphql (14)
- # hoplon (59)
- # keechma (24)
- # lambdaisland (1)
- # lumo (86)
- # off-topic (3)
- # om (19)
- # om-next (1)
- # onyx (4)
- # portkey (20)
- # re-frame (41)
- # reagent (63)
- # ring (1)
- # ring-swagger (1)
- # spacemacs (9)
- # sql (10)
- # yada (13)
hello everyone, is there any recommendation while using core.async
in conjunction with clojure.jdbc
? or i should wrap the queries with core.async/thread
and i’m good to go?
that’s the best plan, yes just return the data from thread and read the channel in your go block to get it
sadly we don’t have good async support in jdbc or else there might be a nicer option (iirc this is an upstream java issue and not a clojure one)
With the latest clojure.java.jdbc
(0.7.0) you have reducible-query
so it should play nice with transducers on channels if that's any help...
(I don't do much with core.async
yet but I'm expecting that to change at some point)
would that mean you’re attaching IO to a channel via its transducer?
anyway, that’s what it seems like, and that could be OK as long as you manage the channel properly so that you aren’t accessing it from go blocks
Hmm, I thought there was something about transducers that would let you connect a (reducible) collection as input to a channel as output, but I don't see anything obvious...
you can attach a transducer to a channel, but I don’t think you can do the inverse
Yeah, I was thinking you could transduce a collection into a channel but it looks like you can create a channel with an attached transducer and then you have to use onto-chan
to get a collection into it... and that doesn't care about a reducible collection.