Skip to content

Commit 064604b

Browse files
authored
Merge pull request swiftlang#74005 from ktoso/pick-wip-ktoso-changelog
[6.0] changelog document SE-0428 and SE-424
2 parents 91c753a + 6aa918f commit 064604b

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,60 @@
55
66
## Swift 6.0
77

8+
* [SE-0428][]:
9+
Distributed actors now have the ability to support complete split server /
10+
client systems, thanks to the new `@Resolvable` macro and runtime changes.
11+
12+
It is now possible to share an "API module" between a client and server
13+
application, declare a resolvable distributed actor protocol with the expected
14+
API contract and perform calls on it, without knowing the specific type the
15+
server is implementing those actors as.
16+
17+
Declaring such protocol looks like this:
18+
19+
```swift
20+
import Distributed
21+
22+
@Resolvable
23+
protocol Greeter where ActorSystem: DistributedActorSystem<any Codable> {
24+
distributed func greet(name: String) -> String
25+
}
26+
```
27+
28+
And the module structure to support such applications looks like this:
29+
30+
```
31+
┌────────────────────────────────────────┐
32+
│ API Module │
33+
│========================================│
34+
│ @Resolvable │
35+
│ protocol Greeter: DistributedActor { │
36+
┌───────┤ distributed func greet(name: String) ├───────┐
37+
│ │ } │ │
38+
│ └────────────────────────────────────────┘ │
39+
│ │
40+
▼ ▼
41+
┌────────────────────────────────────────────────┐ ┌──────────────────────────────────────────────┐
42+
│ Client Module │ │ Server Module │
43+
│================================================│ │==============================================│
44+
│ let g = try $Greeter.resolve(...) /*new*/ │ │ distributed actor EnglishGreeter: Greeter { │
45+
│ try await greeter.hello(name: ...) │ │ distributed func greet(name: String) { │
46+
└────────────────────────────────────────────────┘ │ "Greeting in english, for \(name)!" │
47+
/* Client cannot know about EnglishGreeter type */ │ } │
48+
│ } │
49+
└──────────────────────────────────────────────┘
50+
```
51+
52+
* [SE-0424][]:
53+
Serial executor gain a new customization point `checkIsolation()`, which can be
54+
implemented by custom executor implementations in order to provide a last resort
55+
check before the isolation asserting APIs such as `Actor.assumeIsolated` or
56+
`assertIsolated` fail and crash.
57+
58+
This specifically enables Dispatch to implement more sophisticated isolation
59+
checking, and now even an actor which is "on a queue which is targeting
60+
another specific queue" can be properly detected using these APIs.
61+
862
* Closures can now appear in pack expansion expressions, which allows you to
963
construct a parameter pack of closures where each closure captures the
1064
corresponding element of some other parameter pack. For example:
@@ -10464,6 +10518,9 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
1046410518
[SE-0412]: https://github.com/apple/swift-evolution/blob/main/proposals/0412-strict-concurrency-for-global-variables.md
1046510519
[SE-0413]: https://github.com/apple/swift-evolution/blob/main/proposals/0413-typed-throws.md
1046610520
[SE-0414]: https://github.com/apple/swift-evolution/blob/main/proposals/0414-region-based-isolation.md
10521+
[SE-0424]: https://github.com/apple/swift-evolution/blob/main/proposals/0424-custom-isolation-checking-for-serialexecutor.md
10522+
[SE-0428]: https://github.com/apple/swift-evolution/blob/main/proposals/0428-resolve-distributed-actor-protocols.md
10523+
[SE-0430]: https://github.com/apple/swift-evolution/blob/main/proposals/0430-transferring-parameters-and-results.md
1046710524
[SE-0417]: https://github.com/apple/swift-evolution/blob/main/proposals/0417-task-executor-preference.md
1046810525
[SE-0418]: https://github.com/apple/swift-evolution/blob/main/proposals/0418-inferring-sendable-for-methods.md
1046910526
[SE-0420]: https://github.com/apple/swift-evolution/blob/main/proposals/0420-inheritance-of-actor-isolation.md

0 commit comments

Comments
 (0)