Yet another: I'm using a servlet implementation, that can be deployed in
any servlet container supporting servlet api 3.0 (with async)
https://github.com/webnf/webnf/tree/master/async-servlet

It allows to return a function instead of a regular ring response, that
will get an async context to drive the rest of the response, e.g

(defn handler [req]
  (fn [ac]
    (future (as/status ac 200)
            (as/chunk ac "body")
            (as/complete ac))
    as/log-listener))

Caveats: It only does plain http (no websockets) and any middleware
operating on the response must be compatible with this style of async
response.

On the plus side, it works in any recent servlet server (without tying up a
thread), it seems a pretty good fit for your case of streaming back a
response from a channel and middlewares that only care about the request
(authorization, ...) work just fine.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to