Martin Raison
2015-05-15 05:20:38 UTC
Aleph's README says handlers may return a deferred to represent an eventual
response.
In the HTTP examples
<http://ideolalia.com/aleph/literate.html#aleph.examples.http>, it also
uses compojure/routes to define the routes.
However, before returning the response to the middleware, compojure
actually "renders" the result. This means that, since deferred implements
IDeref, compojure calls deref
<https://github.com/weavejester/compojure/blob/639fffd3f8b77153644d0c9b87bca5af56be0cb0/src/compojure/response.clj#L36>
on the deferred before passing the response back to the middleware. Isn't
this bad? Does anyone have a good solution to prevent compojure from
deref'ing the result? (both my handler and my middleware do asynchronous
operations, so it seems suboptimal to have a deref in the middle of the
chain)
response.
In the HTTP examples
<http://ideolalia.com/aleph/literate.html#aleph.examples.http>, it also
uses compojure/routes to define the routes.
However, before returning the response to the middleware, compojure
actually "renders" the result. This means that, since deferred implements
IDeref, compojure calls deref
<https://github.com/weavejester/compojure/blob/639fffd3f8b77153644d0c9b87bca5af56be0cb0/src/compojure/response.clj#L36>
on the deferred before passing the response back to the middleware. Isn't
this bad? Does anyone have a good solution to prevent compojure from
deref'ing the result? (both my handler and my middleware do asynchronous
operations, so it seems suboptimal to have a deref in the middle of the
chain)
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.