Skip to content

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
@rnro rnro mentioned this pull request Sep 22, 2025
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