Interceptors
Pedestal interceptors are based on a software design pattern called interceptor. Interceptor is a service extension that registers events of interest with the framework and is invoked by the framework when those events occur within the control flow. Once the interceptor is invoked, it executes its functionality, and then the control flow returns to the framework. Most of Pedestal core logic is made up of one or more interceptors that can be composed together to build a chain of interceptors.
Interceptor in Pedestal is defined by a Clojure Map (https://clojure.org/reference/data_structures#Maps) that contains :name, :enter, :leave, and :error keys as shown in the following diagram. The :name key contains a namespaced keyword ( ...
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