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 the ability to generate Swift Concurrency implementations. #70

Conversation

tachyonics
Copy link
Contributor

Issue #, if available:

Description of changes:
Adds support for Swift Concurrency based implementations in a backwards-compatible manner.

These changes only relate to the service-model-swift-code-generate-2.x branch - which is only used to generate the smoke-aws package and (in conjunction with changes to smoke-aws-generate) result in

amzn/smoke-aws@main...on_swift_concurrency_threads

(baseName)ClientProtocolV2: a new protocol that just contains Swift Concurrency (Async/Await) based APIs
(baseName)ClientProtocol: an existing protocol that now conforms to the new (baseName)ClientProtocolV2 protocol. There are no other changes to this protocol.
(baseName)ClientProtocol+async: existing extensions to the existing (baseName)ClientProtocol that provide Swift Concurrency (Async/Await) based APIs by delegating to the callback-based async APIs in the existing protocol. There are no changes to these extensions but they will now satisfy the conformance to the (baseName)ClientProtocolV2 by providing a default implementation unless a conforming type provides one itself.
AWS(baseName)Client: an existing type that conforms to the (baseName)ClientProtocol, adding Swift Concurrency based implementations that call into the Swift Concurrency based APIs of smoke-http. Because these APIs are now implemented within this type, they will override the default implementations in the extension of the protocol.
Mock(baseName)ClientV2 and Throwing(baseName)ClientV2: Mock implementations that conform to the (baseName)ClientProtocolV2 protocol. These implementations just provide the ability to mock the Swift Concurrency (Async/Await) based APIs and therefore do not require passing an EventLoop to their initializer.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tachyonics tachyonics merged commit 40631a9 into service-model-swift-code-generate-2.x Jan 5, 2023
@tachyonics tachyonics deleted the swift_concurrency_implementations_generation branch January 5, 2023 19:02
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.

2 participants