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

Deduplicate interceptor pipeline operation #2157

Merged
merged 7 commits into from
Jan 17, 2025

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Jan 15, 2025

Motivation:

ClientInterceptorPipelineOperation is the same as
ServerInterceptorPipelineOperation apart from the type of interceptor being used. The duplication here is unnecessary.

Modifications:

  • Add a ConditionalInterceptor which is roughly the same as *InterceptorPipelineOperation but is generic.
  • The init is private and can only be initialized via static methods when the generic type is appropriate (i.e. client/server interceptor).

Result:

Less duplication, less code

Motivation:

ClientInterceptorPipelineOperation is the same as
ServerInterceptorPipelineOperation apart from the type of interceptor
being used. The duplication here is unnecessary.

Modifications:

- Add a `ConditionalInterceptor` which is roughly the same as
  `*InterceptorPipelineOperation` but is generic.
- The init is private and can only be initialized via static methods
  when the generic type is appropriate (i.e. client/server interceptor).

Result:

Less duplication, less code
@glbrntt glbrntt added the ⚠️ semver/major Breaks existing public API. label Jan 15, 2025
@glbrntt glbrntt marked this pull request as ready for review January 15, 2025 13:18
@glbrntt glbrntt requested a review from gjcairo January 15, 2025 13:18
@glbrntt glbrntt changed the title Deduplication interceptor pipeline operation Deduplicate interceptor pipeline operation Jan 15, 2025
@glbrntt glbrntt merged commit eb7ed6f into grpc:main Jan 17, 2025
30 of 33 checks passed
@glbrntt glbrntt deleted the v2/conditional-interceptor branch January 17, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ semver/major Breaks existing public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants