Re: core.async | compojure ... odd error ... help!!

2014-09-28 Thread Mike Fikes
Hi mond, I've been using HTTPkit with Compojure and core.async (all fronted by Nginx so the entire stack is async FWIW). To glue core.async with HTTPkit when handling inbound requests, I have a utility function (defn handle-async! [handler req] (http-server/with-channel req channel

Re: core.async | compojure ... odd error ... help!!

2014-09-28 Thread Ray McDermott
Excellent - thanks. Nice to see core.async getting the ring middleware love :) On 28 Sep 2014 at 10:48:57, Max Penet (m...@qbits.cc) wrote: Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matte

Re: core.async | compojure ... odd error ... help!!

2014-09-28 Thread Max Penet
Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday,

Re: core.async | compojure ... odd error ... help!!

2014-09-28 Thread Max Penet
Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday,

Re: core.async | compojure ... odd error ... help!!

2014-09-27 Thread Ray McDermott
Thanks for the tips. I wasn't expecting magic but otherwise your points are well taken Ray Sent from my iPhone > On 27 Sep 2014, at 16:55, James Reeves wrote: > >> On 27 September 2014 10:01, mond wrote: > >> >> Speaking to the main point, no I don't want to put a channel on to the >> res

Re: core.async | compojure ... odd error ... help!!

2014-09-27 Thread James Reeves
On 27 September 2014 10:01, mond wrote: > > Speaking to the main point, no I don't want to put a channel on to the > response so that's a mistake that I see and would like to avoid. I would > like to understand where I have gone wrong. > You're trying to use core.async with a library that has no

Re: core.async | compojure ... odd error ... help!!

2014-09-27 Thread mond
Hi James, Er, nice tip on the routes - that was another thing that I didn't expect to work but was happy when it did ;-) I will of course adapt it to your recommendation. Speaking to the main point, no I don't want to put a channel on to the response so that's a mistake that I see and would li

Re: core.async | compojure ... odd error ... help!!

2014-09-26 Thread James Reeves
Hi Ray, I don't entirely understand why you expected this to work. Channels aren't a valid Ring response body. The error message is essentially telling you that Compojure has no way of turning the channel object you've returned into a valid response. The other problem you have is that the Ring Je

core.async | compojure ... odd error ... help!!

2014-09-26 Thread mond
My first core.async program ... all works outside of the web app but barfs once I put the functions inside a web container. I hope somebody in the group can point to my obvious mistake... The idea is that the function 'respond-within-sla' will give back a result or a come back later message aft