Add support for nonisolated(nonsending) by default #602
+497
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)? = #isolationparameter and rely on thenon isolated(non sending)default instead.Description of changes
LambdaRuntimeClient+ChannelHandler.swift. One copy for Swift >= 6.2 and one copy for Swift < 6.2isolation: isolated (any Actor)? = #isolationon the >= 6.2 versionNew/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:
These projects need to add the same feature flag as the library (
NonisolatedNonsendingByDefault) to compile without errors.When
NonisolatedNonsendingByDefaultwill 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.