-
Notifications
You must be signed in to change notification settings - Fork 651
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
Make assumeIsolated
work with SerialExecutors that are backed by EventLoops
#2865
Conversation
other === self | ||
} | ||
|
||
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should fix the compilation failures
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) | |
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, *) |
|
||
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) | ||
@inlinable | ||
public func isSameExclusiveExecutionContext(other: Self) -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not going to be called yet.
You must adjust asUnownedSerialExecutor
to return UnownedSerialExecutor
with the marker flag (there's a complexEquality:
initializer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(making those calls is costly so we only do it when we know an executor has the ability and that's done via that flag)
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [apple/swift-nio](https://redirect.github.com/apple/swift-nio) | minor | `2.70.0` -> `2.72.0` | --- ### Release Notes <details> <summary>apple/swift-nio (apple/swift-nio)</summary> ### [`v2.72.0`](https://redirect.github.com/apple/swift-nio/releases/tag/2.72.0) [Compare Source](https://redirect.github.com/apple/swift-nio/compare/2.71.0...2.72.0) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### SemVer Minor - Add .compact format to ByteBuffer's hexdump method by [@​supersonicbyte](https://redirect.github.com/supersonicbyte) in [https://github.com/apple/swift-nio/pull/2856](https://redirect.github.com/apple/swift-nio/pull/2856) ##### SemVer Patch - Make `assumeIsolated` work with SerialExecutors that are backed by EventLoops by [@​fabianfett](https://redirect.github.com/fabianfett) in [https://github.com/apple/swift-nio/pull/2865](https://redirect.github.com/apple/swift-nio/pull/2865) #### New Contributors - [@​supersonicbyte](https://redirect.github.com/supersonicbyte) made their first contribution in [https://github.com/apple/swift-nio/pull/2856](https://redirect.github.com/apple/swift-nio/pull/2856) **Full Changelog**: apple/swift-nio@2.71.0...2.72.0 ### [`v2.71.0`](https://redirect.github.com/apple/swift-nio/releases/tag/2.71.0) [Compare Source](https://redirect.github.com/apple/swift-nio/compare/2.70.0...2.71.0) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### SemVer Minor - Adopt strict concurrency and Sendable in `NIOConcurrencyHelpers` by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2832](https://redirect.github.com/apple/swift-nio/pull/2832) - Adopt strict concurrency in `_NIODataStructures` by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2835](https://redirect.github.com/apple/swift-nio/pull/2835) - Provide documentation and context information for `NIOTooManyBytesError` by [@​cmcgee1024](https://redirect.github.com/cmcgee1024) in [https://github.com/apple/swift-nio/pull/2831](https://redirect.github.com/apple/swift-nio/pull/2831) ##### SemVer Patch - Adopt strict concurrency in `_NIOBase64` by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2838](https://redirect.github.com/apple/swift-nio/pull/2838) - Remove symlinks from resources by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2841](https://redirect.github.com/apple/swift-nio/pull/2841) - Fix global concurrency hook integration test by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2857](https://redirect.github.com/apple/swift-nio/pull/2857) ##### Other Changes - Update wording from `ubuntu` to `Ubuntu` at README.md by [@​lamtrinhdev](https://redirect.github.com/lamtrinhdev) in [https://github.com/apple/swift-nio/pull/2830](https://redirect.github.com/apple/swift-nio/pull/2830) - Update the triggers for the Semantic Version label check by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2833](https://redirect.github.com/apple/swift-nio/pull/2833) - Add `.editorconfig` file by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2829](https://redirect.github.com/apple/swift-nio/pull/2829) - Fix test availability by [@​glbrntt](https://redirect.github.com/glbrntt) in [https://github.com/apple/swift-nio/pull/2836](https://redirect.github.com/apple/swift-nio/pull/2836) - Strict concurrency the early tests by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2840](https://redirect.github.com/apple/swift-nio/pull/2840) - Fix `NIOFileSystem` flaky tests by [@​gjcairo](https://redirect.github.com/gjcairo) in [https://github.com/apple/swift-nio/pull/2842](https://redirect.github.com/apple/swift-nio/pull/2842) - Improve `testTasksScheduledDuringShutdownAreAutomaticallyCancelled` by [@​glbrntt](https://redirect.github.com/glbrntt) in [https://github.com/apple/swift-nio/pull/2843](https://redirect.github.com/apple/swift-nio/pull/2843) - Align benchmark scaling and minimum samples by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2839](https://redirect.github.com/apple/swift-nio/pull/2839) - Explain why `ThreadLocalVariable` isn't Sendable. by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2845](https://redirect.github.com/apple/swift-nio/pull/2845) - \[CI] Don't persist git credentials in CI by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2847](https://redirect.github.com/apple/swift-nio/pull/2847) - \[CI] Mark the workspace as safe for the matrix job by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2848](https://redirect.github.com/apple/swift-nio/pull/2848) - Pin DocC to below 1.4 by [@​Lukasa](https://redirect.github.com/Lukasa) in [https://github.com/apple/swift-nio/pull/2854](https://redirect.github.com/apple/swift-nio/pull/2854) - \[CI] Make container images configurable in soundness and matrix jobs … by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2851](https://redirect.github.com/apple/swift-nio/pull/2851) - Update release.yml by [@​FranzBusch](https://redirect.github.com/FranzBusch) in [https://github.com/apple/swift-nio/pull/2850](https://redirect.github.com/apple/swift-nio/pull/2850) #### New Contributors - [@​lamtrinhdev](https://redirect.github.com/lamtrinhdev) made their first contribution in [https://github.com/apple/swift-nio/pull/2830](https://redirect.github.com/apple/swift-nio/pull/2830) - [@​cmcgee1024](https://redirect.github.com/cmcgee1024) made their first contribution in [https://github.com/apple/swift-nio/pull/2831](https://redirect.github.com/apple/swift-nio/pull/2831) **Full Changelog**: apple/swift-nio@2.70.0...2.71.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43Mi4wIiwidXBkYXRlZEluVmVyIjoiMzguNzIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: cgrindel-self-hosted-renovate[bot] <139595543+cgrindel-self-hosted-renovate[bot]@users.noreply.github.com>
Allow usage of
assumeIsolated
in SerialExecutors that are backed by EventLoops.Motivation:
We want to support all new Swift 6 features in SerialExecutors.
Modifications:
isSameExclusiveExecutionContext
checkIsolated
Result:
We can use
assumeIsolated
in actors that use anEventLoop
as theirSerialExecutor
.