-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adding new overload with length for BlobAsyncClient.upload() #30672
Adding new overload with length for BlobAsyncClient.upload() #30672
Conversation
I wonder if a better approach to this would be leveraging the fact that This would hook into the |
API change check API changes are not detected in this pull request. |
// Since we already know the size of our buffered bytes, we can pass the ByteBuffer and length to the BinaryData. | ||
// This will internally convert the BinaryData to a Flux<ByteBuffer>, but with known length we can optimize the | ||
// upload speed. | ||
BinaryData binaryData = BinaryData.fromFlux(sourceData, length).block(); |
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.
Two minor nits:
- This returns a reactive response and can be reactively chained
- There is two Flux length APIs in BinaryData, the one being used here will buffer the stream whereas the overload will allow this to be configured. We should call that out here
resolves #6090
Instead of adding a new overload, we add a sample users can refer to in order to use upload method for a ByteBuffer with a known size.