interceptors

ikitommi 2018-11-11T20:45:43.005500Z

ring will continue with middleware, but as pedestal has shown, interceptors are nicer with async apps. would it be possible to polish the pedestal interceptor spec to be abstract spec like the ring-spec?

ikitommi 2018-11-11T20:46:35.006300Z

would allow one to write (and use!) 3rd party interceptor libs with multiple web frameworks.

ikitommi 2018-11-11T20:49:30.007900Z

If the pedestal-spesific keys for queue, stack and error would be lifted into the spec? e.g. :io.pedestal.interceptor.chain/errorcould be just :error.

ikitommi 2018-11-11T20:52:38.008800Z

so, the interceptors as maps would look like this:

ikitommi 2018-11-11T20:52:42.009Z

{:enter "ctx => ->ctx function with :request key"
 :leave "ctx => ->ctx function with :response key"
 :error "ctx => ->ctx function with :error key"}

ikitommi 2018-11-11T20:53:03.009600Z

or supporting dynamic queuing:

{:enter "ctx => ->ctx function with :request & :queue key"
 :leave "ctx => ->ctx function with :response & :stack key"
 :error "ctx => ->ctx function with :error key"}

ikitommi 2018-11-11T20:53:56.010300Z

that is basically what we did with Sieppari.

ikitommi 2018-11-11T20:56:30.012100Z

@ddeaguiar what do you think?