The interceptor chain
Interceptors in Pedestal can be composed as an interceptor chain that follows the Chain of Responsibility (https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) design pattern. Each interceptor does exactly one job and when composed together as an interceptor chain, they achieve a bigger task consisting of one or more jobs.
The Chain of Responsibility pattern helps with navigating the composite structure of the interceptor chain. The control flow within the interceptor chain is controlled by a Context Map. Since a Context Map itself is passed as input to each interceptor, interceptors can optionally add, remove, or reorder interceptors in the chain. This is one of the reasons why most of the modules of a web ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access