aleph

2019-07-08T09:50:40.015200Z

Hello all

2019-07-08T09:51:02.015700Z

did anyone bump into this kind of error? any tips appreciated

2019-07-08T09:51:29.015800Z

mccraigmccraig 2019-07-08T09:54:15.018200Z

@dimovich looking at the stacktrace you are attempting to use a vanilla ring middleware which doesn't support Deferred responses

2019-07-14T18:09:08.029700Z

@mccraigmccraig What's the best approach here? Only thing that I see possible is to wrap my initial handler with a middleware that will dereference the Deferred.

mccraigmccraig 2019-07-14T18:13:43.030Z

derefing is pretty much a no-no for an async program - you will block a thread and possibly cause a deadlock (the only places derefing makes sense are in the repl and maybe in a sync test driving async code). either find a different middleware which is async compatible, or copy the existing middleware and modify it to be async friendly

2019-07-14T21:33:23.030200Z

thank you for the tips! will experiment with that.

alexyakushev 2019-07-08T09:54:28.018500Z

Apparently, your handler returns a Deferred, but you have some Ring middleware that post-processes the response.

2019-07-14T18:06:18.029500Z

@alexyakushev yes, ring.middleware.session/wrap-session is trying to read the Deferred response and fails. Seems there is a project that provides async versions of middlewares -- https://github.com/muhuk/aleph-middleware

2019-07-08T09:55:32.018900Z

@mccraigmccraig @alexyakushev thanks!