Skip to content

Conversation

@sebsto
Copy link
Collaborator

@sebsto sebsto commented Nov 12, 2025

The goal of this PR is to simplify the code and take advantage of new capabilities offered by the Swift 6.2 compiler, when possible.

However, one of the tenet of this project is to support the last three Swift version (6.0, 6.1, and 6.2 at the time of this writing). I therefore introduced this change for Swift 6.2 only, keeping existing code for Swift 6.0 and Swift 6.1.
When this change will be merged, we will create an issue to remember cleaning up this code when this project will not support 6.0 and 6.1 anymore (when 6.4 will be released, probably in Sept - Oct 2026)

Issue #

Get rid of the isolation: isolated (any Actor)? = #isolation parameter and rely on the non isolated(non sending) default instead.

Description of changes

  • Enable two feature flags for upcoming features
        .enableUpcomingFeature("NonisolatedNonsendingByDefault"),
        .enableUpcomingFeature("InferIsolatedConformances"),
  • Duplicate the file LambdaRuntimeClient+ChannelHandler.swift. One copy for Swift >= 6.2 and one copy for Swift < 6.2
  • Remove isolation: isolated (any Actor)? = #isolation on the >= 6.2 version

New/existing dependencies impact assessment, if applicable

n/a

API Breakage

The API breakage reported by the CI action fails to detect that the concurrent behaviour is non breaking
when using "NonisolatedNonsendingByDefault". For project not using this feature flag, the proposed change is breaking.

To be more precise, this change breaks projects on Swift 6.2 when they use the low level handler:

    public mutating func handle(
        _ event: ByteBuffer,
        responseWriter: some LambdaResponseStreamWriter,
        context: LambdaContext

These projects need to add the same feature flag as the library (NonisolatedNonsendingByDefault) to compile without errors.

When NonisolatedNonsendingByDefault will be applied by default, this change will not break API.

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

@sebsto sebsto self-assigned this Nov 12, 2025
@sebsto sebsto added the 🔨 semver/patch No public API change. label Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant