Fork me on GitHub

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 (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.