Commit Graph
8 Commits
Author SHA1 Message Date
Fabian FettandCory Benfield a3ed8e10ab Drop Swift 5.10 (#3393)
This PR drops Swift 5.10 and enables Swift 6 language mode.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2025-10-06 10:58:33 +01:00
Johannes Weiss dd7d4b0fb1 fix warnings: syncShutdownGracefully not available in async contexts (#2995)
### Motivation:

Warnings are annoying. Companion of #2994 

### Modifications:

Fix all the `syncShutdownGracefully` not being available in `async`
contexts warnings.

### Result:

Everybody happier.
2024-11-25 09:58:25 +00:00
Franz Busch 2fe3d92cf5 Drop support for Swift 5.8 (#2924)
# Motivation

We only support the last three Swift released versions which are at this
time 5.9, 5.10 and 6.

# Modification

This PR drops anything related to Swift 5.8.

# Result

Version support aligned.
2024-10-17 12:22:10 +00:00
Fabian Fett 9746cf80e2 Make assumeIsolated work with SerialExecutors that are backed by EventLoops (#2865)
Allow usage of `assumeIsolated` in SerialExecutors that are backed by
EventLoops.

### Motivation:

We want to support all new Swift 6 features in SerialExecutors.

### Modifications:

- Implement `isSameExclusiveExecutionContext`
- Implement `checkIsolated`

### Result:

We can use `assumeIsolated` in actors that use an `EventLoop` as their
`SerialExecutor`.
2024-09-03 14:41:34 +00:00
Franz Busch c9756e1083 Adopt swift-format (#2794)
* Apply formatting

* Apply no block comments rule

* Apply OmitExplicitReturns

* Apple OnlyOneTrailingClosureArgument

* Apply NoAssignmentInExpressions

* Fix up DontRepeatTypeInStaticProperties lint errors

* Apply `OrderedImports`

* Apply `ReplaceForEachWithForLoop`

* format file

* Enable the formatting pipeline

* Adopt `AmbiguousTrailingClosureOverload`

* Fix license header

* Fix format check

* Fix `EndOfLineComment`

* Fix CI

* Adapt CI script to check if changes when running formatting

* Separate lint and format into to steps

* Fix format

* Adopt `UseEarlyExits`

* Revert "Adopt `UseEarlyExits`"

This reverts commit d1ac5bbe12.
2024-07-19 11:48:17 +02:00
Franz Busch 50ae57ac9d Fix test availability annotations (#2607)
# Motivation
We are currently missing a bunch of annotations in our tests which leads to compilation failures if you build against generic iOS/macOS/watchOS/tvOS

# Modification
This PR adds the missing availability annotations in the tests.
2023-12-08 05:12:29 -08:00
Franz Busch 80249029d0 Add missing availability guards in tests (#2596)
# Motivation
We were missing a few availability guards in our tests which causes compile time errors when building for older Darwin SDKs.

# Modification
This PR adds the missing availability guards.
2023-11-24 07:53:55 -08:00
Cory Benfield 5be5ccb5a7 Initial PoC of Custom Actor Executor support (#2388)
* Support NIO Event Loops as actor executors

Motivation

Swift Concurrency supports having actors opt in to executing
within a "custom executor". This requires being able to be strictly
serial, a constraint that NIO's EventLoops natively meet. It is
useful to have actors be able to express a "tie" to an EventLoop
in order to efficiently access objects that are tied to specific ELs.

Modifications

- Extend EventLoop to expose an executor property
- Provide a simple best-effort default using NIODefaultSerialEventLoopExecutor
- Expose NIOSerialEventLoopExecutor protocol that makes it easy
  for adopters to get a better implementation
- Crash if EmbeddedEventLoop is used
- Add tests

Result

Adopters can use ELs as serial executors

* Prefer #if compiler
2023-07-31 07:19:49 -07:00