metosin / sieppari

Small, fast, and complete interceptor library for Clojure/Script
Eclipse Public License 2.0
207 stars 21 forks source link

Pedestal style terminate-when #29

Open martinklepsch opened 4 years ago

martinklepsch commented 4 years ago

See Early Termination in the Pedestal docs + part of the source

I think this kind of hook is something that's missing from Sieppari right now.

martinklepsch commented 4 years ago

I just saw that there is sieppari.context/terminate, while that's a part of this it still means that Sieppari can't accept any "terminate when ..." style instructions. E.g. we might want to not execute any more interceptors once the :response key is set.

https://github.com/metosin/sieppari/blob/8cf22f73b34699d947858be2ba12455ab0b823ff/src/sieppari/context.cljc#L4-L14