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

Http Protocol Refactor & Streaming Request bodies (breaking change) #359

Merged
merged 7 commits into from
May 12, 2021

Conversation

rcoh
Copy link
Collaborator

@rcoh rcoh commented May 10, 2021

Issue #, if available: Fixes #215
Description of changes: This change, split into two commits:

  1. Refactors the code to generate bodies for HTTP based protocols
  2. Enables support for streaming request bodies, which via a stroke of luck, worked without modification after the refactor.

These refactors (besides cleaning up the code) improve the performance of serializers by avoiding an unnecessary when serializing Blob & ByteStream operations. This is facilitated via BodyMetadata which allows a body serializer to communicate whether it requires ownership of the request object.

In general, we try to generate operations that do not take ownership of the request object enabling operation reuse.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@rcoh rcoh requested a review from a team May 10, 2021 21:42
Copy link

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

The Rust code looks fine (I'm not an expert in Kotlin or the SDK protocols...).

@rcoh rcoh changed the title Http protocol refactor Http Protocol Refactor & Streaming Request bodies (breaking change) May 11, 2021
@rcoh rcoh enabled auto-merge (squash) May 11, 2021 23:55
@rcoh rcoh merged commit 42c1f21 into main May 12, 2021
@rcoh rcoh deleted the http-protocol-refactor branch May 12, 2021 00:04
rcoh added a commit that referenced this pull request May 12, 2021
…359)

* Refactor HttpProtocolGenerator body construction

* Well that was easy... (add streaming input support)

* Fix tests, clippy warning

* One more clippy wrap ignore

* Fix test that used private API

* Add test for default value
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.

Streaming request payloads
2 participants