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
Guess ExchangeType
if it is not set in RequestOptions
#5517
Conversation
Motivation: `ExchangeType` is a hint for performance optimization. If no `RequestOptions` is set, it is inferred from the type of `HttpRequest`. However, a custom `RequestOptions` is set, `ExchangeType` is not inferred even if the `RequestOptions.exchangeType()` is null. Modifications: - Use `ExchangeType.RESPONSE_STREAMING` if `RequestOptions.exchangeType()` is null and `HttpRequest` is an instance of `FixedStreamMessage`. Result: `ExchangeType` is guessed correctly even if `RequestOptions` is set.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5517 +/- ##
===========================================
+ Coverage 0 74.04% +74.04%
- Complexity 0 20798 +20798
===========================================
Files 0 1801 +1801
Lines 0 76576 +76576
Branches 0 9761 +9761
===========================================
+ Hits 0 56701 +56701
- Misses 0 15255 +15255
- Partials 0 4620 +4620 ☔ View full report in Codecov by Sentry. |
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.
Looks straightforward enough 👍 Thanks @ikhoon 🙇 👍 🙇
+ Please check the lint failures 🙇 |
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.
Updated to modification:
- If none of the above conditions are met, the method defaults to returning
ExchangeType.BIDI_STREAMING
.
Could you explain this default meaning?
Good question. Otherwise, we use a streaming My answer may not be sufficient to explain Armeria's stream processors. If you want to know more about that, please let us know. |
Thanks for explaining to me 🙇 |
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.
Great, thanks!
Motivation:
ExchangeType
is a hint for performance optimization. If noRequestOptions
is set, it is inferred from the type ofHttpRequest
. However, a customRequestOptions
is set,ExchangeType
is not inferred even if theRequestOptions.exchangeType()
is null.Modifications:
ExchangeType.RESPONSE_STREAMING
ifRequestOptions.exchangeType()
is null andHttpRequest
is an instance ofFixedStreamMessage
.Result:
ExchangeType
is guessed correctly even ifRequestOptions
is set.