Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pedestal style terminate-when #29

Open
martinklepsch opened this issue Apr 1, 2020 · 1 comment
Open

Pedestal style terminate-when #29

martinklepsch opened this issue Apr 1, 2020 · 1 comment

Comments

@martinklepsch
Copy link

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
Copy link
Author

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.

(defn terminate
"Removes all remaining interceptors from context's execution queue.
This effectively short-circuits execution of Interceptors' :enter
functions and begins executing the :leave functions.
Two arity version allows setting the response at the same call."
([ctx]
(assoc ctx :queue q/empty-queue))
([ctx response]
(-> ctx
(assoc :queue q/empty-queue)
(assoc :response response))))

@martinklepsch martinklepsch changed the title Pedestal style termination Pedestal style terminate-when Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant