Deprecate and replace com.walmartlabs.lacinia.pedestal.interceptors #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the process of upgrading our internal applications to lacina-pedestal 0.6.0, I found the dependency-based approach for interceptors to be over-engineered and confusing.
Generally, I've found that you simply add a new interceptor before or after another interceptor, starting from the known and expected ordering.
In practice, the dependency ordering logic got in the way, leading to fragile and confusing code to get the desired new interceptor into the right position.
So mea culpa; this PR is about deprecating that for a release, and switching the logic around so that the normal path is to operate on a vector (or seq) of interceptors.
The new inject function is used to add new interceptors to the vector with a position relative to an existing interceptor (either immediately before or immediately after, or actually replacing the
interceptor).
There's also some temporary logic that allows either a dependency map (0.6.0 code) or a interceptor vector (0.7.0 code) to work.
I doubt too many folks outside of Walmart used the lacinia.pedestal.interceptors namespace, but 0.7.0 will represent a chance to shift to this simpler model.