Skip to content

Conversation

@dayaffe
Copy link
Contributor

@dayaffe dayaffe commented Dec 11, 2025

Issue #

Description of changes

New/existing dependencies impact assessment, if applicable

Conventional Commits

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

@dayaffe dayaffe changed the title feat: Make clients and configurations sendable including sample generated S3 feat: Make clients and configurations sendable Dec 12, 2025
@dayaffe dayaffe requested a review from jbelkins December 12, 2025 20:51
@@ -58,7 +58,7 @@ extension ExplicitBlobInput {
val contents = getClientFileContents("Sources/Example", "ExampleClient.swift", context.manifest)
contents.shouldSyntacticSanityCheck()
val expectedContents = """
public class ExampleClient: AWSClientRuntime.AWSServiceClient {
public final class ExampleClient: AWSClientRuntime.AWSServiceClient, Sendable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than explicitly mark every client, we should just add Sendable conformance to ClientRuntime.Client protocol

@@ -82,7 +82,7 @@ public class ExampleClient: AWSClientRuntime.AWSServiceClient {

extension ExampleClient {

public class ExampleClientConfiguration: AWSClientRuntime.AWSDefaultClientConfiguration & AWSClientRuntime.AWSRegionClientConfiguration & ClientRuntime.DefaultClientConfiguration & ClientRuntime.DefaultHttpClientConfiguration {
public final class ExampleClientConfiguration: AWSClientRuntime.AWSDefaultClientConfiguration & AWSClientRuntime.AWSRegionClientConfiguration & ClientRuntime.DefaultClientConfiguration & ClientRuntime.DefaultHttpClientConfiguration, @unchecked Sendable {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we already discussed this, but using @unchecked Sendable here isn't appropriate because the client config is not actually safe to use across Swift Concurrency isolation boundaries; a class with var properties is not Sendable, even if the type of the var is Sendable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline -- we want to refactor the configuration class to be a struct with immutable properties to achieve Sendability

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