Fork me on GitHub

Following up with the async and sync discussion. I still couldn't figure this out so maybe a good soul in the community would post something about it. I'm sure this isn't the first time this issue is bring to the light. I created a repository with the problem scenario: I'm back working in the issue and I created a repository with the scenario..


@wcalderipe you app should either be fully (sync) ring or async-ring (3 arity). In your example, line41, you define it as sync (1 arity). I don't think you can mix them in ring. Interceptor-model allows you to do it.


Thanks for taking a look on it 🙌 basically this is my original questions "can sync and async handlers coexist in ring?" and you might have answered it. Also, after you mentioned the interceptor model, I quickly found a good article about it, thanks!


an easy comparison: • with middleware: • with interceptors: … the latter has one route returning a async value, a Manifold Deferred. All others all sync.


Thanks for sharing it!


More interceptor docs: Although it was really this Cognicast podcast that first introduced me to the reasoning behind Pedestal's interceptors and how they can be useful in modeling flow (outside of HTTP):


I never really used Pedestal for anything, but I sure am happy that Paul deGrandis introduced me to the interceptor pattern. And it's nice that with things like metosin/sieppari I can use them without importing pedestal.


Thanks for sharing @U05476190 I'll definitely listen to it today