pedestal-docs
pedestal-docs copied to clipboard
Content for the "What is an Interceptor?" guide needs to be written
Topics to cover:
- [x] Basic structure of
:enter,:leave, and:errorfunctions - [x] Creating an interceptor from a map
- [x] Interceptors as values (i.e.,
defwith a map) - [x] Interceptors constructed in functions (closing over state)
- [x] The
IntoInterceptorprotocol (use adefrecordfor an example) - [x] Async return from an interceptor
- [x] Streaming response bodies
- [x] Distinction between interceptors as a general technique vs. the HTTP handling interceptors in Pedestal
I've fixed a couple of typos that I'll post a PR for if you like, but I'm not sure your intent with this paragraph (first sentence or so, really).
This is where we have to start being precise about the difference between an interceptor how it gets invoked. "Interceptor" is a very general concept.
Do you intend, ...the difference between an interceptor and middleware..., or ...start being precise about how an interceptor gets invoked. I feel like this is a placeholder for more explanation.
I’d be delighted to see a PR.
For that paragraph, the intent is to distinguish Interceptors as a general model for use in other, non-web, contexts versus the way that servlet-interceptor uses them.
It’s significant because the behavior of stopping once a response is attached is specific to the servlet-interceptor’s chain. Likewise, the notion of a handler function being treated automatically as an interceptor is very specific to web requests.
Not all of this will go into "What is an Interceptor?" which is more of a beginner's introduction, but I've verified that all the bullet-items in the list are present there or in the reference pages (or both).