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

Add SharedAsyncSleep wrapping Arc<dyn AsyncSleep> #2742

Merged
merged 13 commits into from
Jun 2, 2023

Conversation

ysaito1001
Copy link
Contributor

@ysaito1001 ysaito1001 commented Jun 1, 2023

Motivation and Context

Add SharedAsyncSleep wrapping Arc<dyn AsyncSleep> and update call sites of Arc<dyn AsyncSleep> to use SharedAsyncSleep

Description

Public APIs that take/return a trait object for AsyncSleep have been using Arc<dyn AsyncSleep> in the codebase. This has a downside of exposing a bare Arc, making it difficult to change the APIs in the future without breaking backwards compatibility. This PR adds a newtype wrapper SharedAsyncSleep that hides Arc<dyn AsyncSleep> to alleviate the said issue (the idiom of having SharedXXX has been seen in the codebase, e.g. SharedTimeSource, SharedCredentialsProvider, and so on).

Testing

  • Passed tests in CI

Checklist

  • I have updated CHANGELOG.next.toml if I made changes to the smithy-rs codegen or runtime crates
  • I have updated CHANGELOG.next.toml if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates

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

@ysaito1001 ysaito1001 added the breaking-nominated-q2 Breaking changes slated for q2-2023 release label Jun 1, 2023
@ysaito1001 ysaito1001 added breaking-change This will require a breaking change and removed breaking-nominated-q2 Breaking changes slated for q2-2023 release labels Jun 2, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Jun 2, 2023
@github-actions
Copy link

github-actions bot commented Jun 2, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@ysaito1001 ysaito1001 marked this pull request as ready for review June 2, 2023 03:36
@ysaito1001 ysaito1001 requested review from a team as code owners June 2, 2023 03:36
Copy link
Collaborator

@jdisanti jdisanti left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few minor comments.

aws/rust-runtime/aws-config/src/connector.rs Outdated Show resolved Hide resolved
aws/rust-runtime/aws-types/src/sdk_config.rs Outdated Show resolved Hide resolved
rust-runtime/aws-smithy-async/src/rt/sleep.rs Show resolved Hide resolved
rust-runtime/aws-smithy-async/src/rt/sleep.rs Show resolved Hide resolved
Co-authored-by: John DiSanti <jdisanti@amazon.com>
@github-actions
Copy link

github-actions bot commented Jun 2, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@ysaito1001 ysaito1001 enabled auto-merge June 2, 2023 19:28
@ysaito1001 ysaito1001 added this pull request to the merge queue Jun 2, 2023
@github-actions
Copy link

github-actions bot commented Jun 2, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

Merged via the queue into main with commit 500aef3 Jun 2, 2023
@ysaito1001 ysaito1001 deleted the ysaito/add-shared-async-sleep branch June 2, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will require a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants