funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
2017-01-31T16:16:32.000560Z

Hi, I've just started playing around with Catacumba and Clojure and I wanted to ask a quick question. Most of my routes so far map directly to a database call which I'm wrapping in the Catacumba blocking function. Now I'm moving to routes which invoke multiple blocking calls and so I started by doing everything in a go block (with the blocking calls putting values onto channels when complete) for better expression. However doing this gives the error around the blocking function not being called from a compute thread due to it using the go thread pool . I was wondering what would be the best of way of structuring my code, can I get the blocking calls to work in a go block, or should I replace the blocking call with the thread based put and take async functions ( <!! / >!! ) or should I do something else? Any advice is appreciated!

niwinz 2017-01-31T16:20:32.000561Z

Hmm, I think using just go and <! is a way to go

niwinz 2017-01-31T16:20:55.000562Z

in any case this is nothing related directly to catacumba,

niwinz 2017-01-31T16:21:16.000563Z

if you have async server the blocking calls you should defer them to different pool of execution

niwinz 2017-01-31T16:21:32.000564Z

go thread pool is an option in this case

niwinz 2017-01-31T16:21:54.000565Z

the only responsability you have with catacumba is return something that catacumba can understand from the handler

niwinz 2017-01-31T16:22:13.000566Z

and the core.async channel is already valid abstraction

2017-01-31T16:25:42.000567Z

Yep sorry, I know it's not directly related to catacumba I just wanted some input on preferred approaches. Many thanks for your suggestion, I'll give it a go!