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

Deprecate and replace com.walmartlabs.lacinia.pedestal.interceptors #52

Merged
merged 3 commits into from Feb 15, 2018

Conversation

hlship
Copy link
Member

@hlship hlship commented Jan 16, 2018

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.

@hlship hlship added this to the 0.7.0 milestone Jan 16, 2018
@hlship hlship self-assigned this Jan 16, 2018
hlship and others added 2 commits February 2, 2018 11:13
@bcarrell bcarrell merged commit 8adfe10 into master Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants