-
Notifications
You must be signed in to change notification settings - Fork 222
add: callback trait proposed in rfc#0012 #1329
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
Conversation
add: callback setting API to ByteStream add: callback setting API to SdkBody add: callback tests for streaming and buffered data add: private callback fns for calculating checksums udpate: pub methods on private struct `Inner` to be private update: changelog remove: Sync bound from SdkBody test "sdk_body_is_send()" add: fn to merge `HeaderMap`s by appending add: tests for new functionality
|
I'm putting this up for initial review. It has two TODOs that I could use some advising on. Currently, the checksum callbacks are private because I don't want people to start messing with them. This PR, once merged, will be followed by another PR that implements the codegen side of things and makes the callbacks public. |
refactor: poll_trailers method update: split out checksum callbacks into their own module formatting: use throwaway let binding instead of allow unused variable
add: readme file to new crate
jdisanti
left a comment
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 great! I just have some minor comments and bike shedding.
| assert!(logs_contain("callback A was called")); | ||
| assert!(logs_contain("callback B was called")); |
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.
Do we care what order these were called in? I don't think the log testing will inform on that.
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 think no. I'm uncomfortable with users depending on callbacks running in a specific order because it just seems like that would be a source of bugs/confusion. This test exists to show that all callbacks get called when setting more than one.
add: two more append_merge_header_maps tests update: make append_merge_header_maps pub(crate) remove: check for non-existent log line
|
A new generated diff is ready to view.
A new doc preview is ready to view. Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
|
A new generated diff is ready to view.
A new doc preview is ready to view. Rust Wrk benchmark report:Duration: 90 sec, Connections: 32, Threads: 2
|
jdisanti
left a comment
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.
LGTM!
Motivation and Context
Implements the Body Callback RFC
Description
add: callback setting API to ByteStream
add: callback setting API to SdkBody
add: callback tests for streaming and buffered data
add: private callback fns for calculating checksums
udpate: pub methods on private struct
Innerto be privateupdate: changelog
remove: Sync bound from SdkBody test "sdk_body_is_send()"
add: fn to merge
HeaderMaps by appendingadd: tests for new functionality
Testing
ran existing tests and created new ones
Checklist
CHANGELOG.next.tomlif I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.tomlif I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.