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

Let users move GrpcLifecycleObserver in the filter chain #2171

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

gRPC users can not use HttpLifecycleObserverServiceFilter to install
GrpcLifecycleObserver because onGrpcStatus won't be invoked.
Sometimes, it's necessary to see the state of other filters from inside
the observer.

Modifications:

  • Make HttpLifecycleObserverServiceFilter extensible as a class, but
    keep all its methods final;
  • Add GrpcLifecycleObserverServiceFilter;

Result:

Users can install GrpcLifecycleObserver anywhere in a filter chain.

Motivation:

gRPC users can not use `HttpLifecycleObserverServiceFilter` to install
`GrpcLifecycleObserver` because `onGrpcStatus` won't be invoked.
Sometimes, it's necessary to see the state of other filters from inside
the observer.

Modifications:

- Make `HttpLifecycleObserverServiceFilter` extensible as a class, but
keep all its methods `final`;
- Add `GrpcLifecycleObserverServiceFilter`;

Result:

Users can install `GrpcLifecycleObserver` anywhere in a filter chain.
@idelpivnitskiy idelpivnitskiy self-assigned this Apr 1, 2022
@@ -161,6 +161,12 @@ public final HttpExecutionStrategy requiredOffloads() {
return HttpExecutionStrategies.offloadNone();
}

@Override
public final HttpExecutionStrategy influenceStrategy(final HttpExecutionStrategy strategy) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to implement both methods? I thought @bondolo set this up so that if requiredOffloads is implemented we should take the strategy from there?

Copy link
Member Author

@idelpivnitskiy idelpivnitskiy Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal was to make all existing methods final even if they are deprecated. It won't be invoked at runtime

@idelpivnitskiy idelpivnitskiy merged commit c8d0139 into apple:main Apr 1, 2022
@idelpivnitskiy idelpivnitskiy deleted the grpc-lf branch April 1, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants