Skip to content

Commit ed85087

Browse files
authored
Merge pull request #74004 from ktoso/wip-ktoso-changelog
changelog document SE-0428 and SE-424
2 parents ab898c0 + 774554a commit ed85087

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

CHANGELOG.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
## Swift 6.0
77

8-
98
* Swift 6 comes with a new language mode that prevents the risk of data races
109
at compile time. This guarantee is accomplished through _data isolation_; the
1110
compiler will validate that data passed over a boundary between concurrently
@@ -22,6 +21,60 @@
2221
You can enable the Swift 6 language mode using the `-swift-version 6`
2322
compiler flag.
2423

24+
* [SE-0428][]:
25+
Distributed actors now have the ability to support complete split server /
26+
client systems, thanks to the new `@Resolvable` macro and runtime changes.
27+
28+
It is now possible to share an "API module" between a client and server
29+
application, declare a resolvable distributed actor protocol with the expected
30+
API contract and perform calls on it, without knowing the specific type the
31+
server is implementing those actors as.
32+
33+
Declaring such protocol looks like this:
34+
35+
```swift
36+
import Distributed
37+
38+
@Resolvable
39+
protocol Greeter where ActorSystem: DistributedActorSystem<any Codable> {
40+
distributed func greet(name: String) -> String
41+
}
42+
```
43+
44+
And the module structure to support such applications looks like this:
45+
46+
```
47+
┌────────────────────────────────────────┐
48+
│ API Module │
49+
│========================================│
50+
│ @Resolvable │
51+
│ protocol Greeter: DistributedActor { │
52+
┌───────┤ distributed func greet(name: String) ├───────┐
53+
│ │ } │ │
54+
│ └────────────────────────────────────────┘ │
55+
│ │
56+
▼ ▼
57+
┌────────────────────────────────────────────────┐ ┌──────────────────────────────────────────────┐
58+
│ Client Module │ │ Server Module │
59+
│================================================│ │==============================================│
60+
│ let g = try $Greeter.resolve(...) /*new*/ │ │ distributed actor EnglishGreeter: Greeter { │
61+
│ try await greeter.hello(name: ...) │ │ distributed func greet(name: String) { │
62+
└────────────────────────────────────────────────┘ │ "Greeting in english, for \(name)!" │
63+
/* Client cannot know about EnglishGreeter type */ │ } │
64+
│ } │
65+
└──────────────────────────────────────────────┘
66+
```
67+
68+
* [SE-0424][]:
69+
Serial executor gains a new customization point `checkIsolation()`, which can be
70+
implemented by custom executor implementations in order to provide a last resort
71+
check before the isolation asserting APIs such as `Actor.assumeIsolated` or
72+
`assertIsolated` fail and crash.
73+
74+
This specifically enables Dispatch to implement more sophisticated isolation
75+
checking, and now even an actor which is "on a queue which is targeting
76+
another specific queue" can be properly detected using these APIs.
77+
2578
* [SE-0431][]:
2679
You can now require a function value to carry its actor isolation
2780
dynamically in a way that can be directly read by clients:
@@ -10514,6 +10567,10 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
1051410567
[SE-0429]: https://github.com/apple/swift-evolution/blob/main/proposals/0429-partial-consumption.md
1051510568
[SE-0432]: https://github.com/apple/swift-evolution/blob/main/proposals/0432-noncopyable-switch.md
1051610569
[SE-0430]: https://github.com/apple/swift-evolution/blob/main/proposals/0430-transferring-parameters-and-results.md
10570+
[SE-0418]: https://github.com/apple/swift-evolution/blob/main/proposals/0418-inferring-sendable-for-methods.md
10571+
[SE-0423]: https://github.com/apple/swift-evolution/blob/main/proposals/0423-dynamic-actor-isolation.md
10572+
[SE-0424]: https://github.com/apple/swift-evolution/blob/main/proposals/0424-custom-isolation-checking-for-serialexecutor.md
10573+
[SE-0428]: https://github.com/apple/swift-evolution/blob/main/proposals/0428-resolve-distributed-actor-protocols.md
1051710574
[SE-0431]: https://github.com/apple/swift-evolution/blob/main/proposals/0431-isolated-any-functions.md
1051810575
[#64927]: <https://github.com/apple/swift/issues/64927>
1051910576
[#42697]: <https://github.com/apple/swift/issues/42697>

0 commit comments

Comments
 (0)