-
Notifications
You must be signed in to change notification settings - Fork 184
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
Apply optimized execution strategy for converted connections #2634
Conversation
Motivation: When client is converted to a different API, the API optimizes default strategy. We should do the same when we convert a reserved connection to a different API. Modifications: - Apply an execution strategy inside request method of every `ReservedStreamingHttpConnectionToReserved*HttpConnection`; Result: Converted connections apply the same strategy as converted clients.
@@ -144,6 +145,7 @@ public <T> BlockingIterable<? extends T> transportEventIterable(final HttpEventK | |||
|
|||
@Override | |||
public HttpResponse request(final HttpRequest request) throws Exception { | |||
request.context().putIfAbsent(HTTP_EXECUTION_STRATEGY_KEY, strategy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't have cycles right now to deal with ClientEffectiveStrategyTest
.
I've verified locally that it works as expected after my fix and filed #2635.
The idea is that the request method for every ReservedStreamingHttpConnectionToReserved*HttpConnection
should behave the same way as its top-level StreamingHttpClientTo*HttpClient
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some comments clarifying why and maybe an internal static utility function that makes it easier to track?
@@ -144,6 +145,7 @@ public <T> BlockingIterable<? extends T> transportEventIterable(final HttpEventK | |||
|
|||
@Override | |||
public HttpResponse request(final HttpRequest request) throws Exception { | |||
request.context().putIfAbsent(HTTP_EXECUTION_STRATEGY_KEY, strategy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some comments clarifying why and maybe an internal static utility function that makes it easier to track?
Motivation:
When a client is converted to a different API, the API optimizes the default strategy. We should do the same when we convert a reserved connection to a different API.
Modifications:
ReservedStreamingHttpConnectionToReserved*HttpConnection
;Result:
Converted connections apply the same strategy as converted clients.