-
Notifications
You must be signed in to change notification settings - Fork 938
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
Add StreamMessage.of(inputStream)
#4703
Add StreamMessage.of(inputStream)
#4703
Conversation
a68980d
to
7c7de9c
Compare
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessageBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessageBuilder.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/StreamMessage.java
Outdated
Show resolved
Hide resolved
@injae-kim Why don't you send a PR to https://github.com/softwaremill/tapir in which I left a TODO for this issue when a new version is released? 😉 |
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.
Overall, looks good.
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
oh~ after this PR is merged and released with new version, I'll also send PR to |
if (this.blockingTaskExecutor != null) { | ||
blockingTaskExecutor = this.blockingTaskExecutor; | ||
} else { | ||
final ServiceRequestContext serviceRequestContext = ServiceRequestContext.currentOrNull(); | ||
if (serviceRequestContext != null) { | ||
blockingTaskExecutor = serviceRequestContext.blockingTaskExecutor(); | ||
} else { | ||
blockingTaskExecutor = CommonPools.blockingTaskExecutor(); | ||
} | ||
} |
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.
I see some duplications between this class and PathStreamMessage
. Can we deduplicate as much as possible, potentially introducing a common supertype?
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 we deduplicate as much as possible, potentially introducing a common
supertype
?
SGTM! but may I handle it with another issue & PR?
Cause I think we need some discussion about this issue 🙇
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.
If you want to handle it in a separate issue, it is okay to send a clean-up PR.
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.
I'll send clean-up PR after this PR is merged~!
core/src/test/java/com/linecorp/armeria/common/stream/InputStreamStreamMessageTest.java
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/common/stream/InputStreamStreamMessageTckTest.java
Show resolved
Hide resolved
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.
In terms of correctness InputStreamStreamMessage
looks good 👍 I think this PR is almost done! 🚀 Left only nit comments 🙇
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/AbstractByteStreamMessageBuilder.java
Show resolved
Hide resolved
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.
The changeset looks good to me (bar the comment #4703 (comment) which I think you'll be following up on) 😄
Thanks @injae-kim 👍 🙇 👍
core/src/main/java/com/linecorp/armeria/common/stream/StreamMessage.java
Show resolved
Hide resolved
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.
Thanks! Left some suggestions and a question. 😄
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessageBuilder.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/StreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
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.
Thanks a lot for adding this nice feature! 👍 🙇 👍
core/src/main/java/com/linecorp/armeria/common/stream/PathStreamMessageBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/PathStreamMessageBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
796198e
to
5898efa
Compare
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.
👍 once all others comments are addressed.
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/InputStreamStreamMessage.java
Outdated
Show resolved
Hide resolved
…eamStreamMessage.java
…eamStreamMessage.java
core/src/main/java/com/linecorp/armeria/common/stream/StreamMessage.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/common/stream/StreamMessage.java
Show resolved
Hide resolved
core/src/test/java/com/linecorp/armeria/common/stream/InputStreamStreamMessageTest.java
Outdated
Show resolved
Hide resolved
…eamStreamMessageTest.java
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.
Awesome work! 🚀💯
Related Issue #3937
Motivation:
Modifications:
StreamMessage.of(inputStream)
InputStreamStreamMessage
and builderResult:
StreamMessage.of(inputStream)
to convert anInputStream
toStreamMessaeg<HttpData>
that splits the binary by the bufferSizeStreamMessage.of(inputStream, bufferSize)
#3937 issue