You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,16 @@ To install using Swift Package Manager, add this to the `dependencies:` section
22
22
23
23
# Usage
24
24
25
-
With Swift 6, usage is similar to existing continuations where the closure is executed syncronously within the current isolation allowing actors to mutate their isolated state.
25
+
With Swift 6, usage is similar to existing continuations.
26
26
27
27
```swift
28
28
let val: String=awaitwithIdentifiableContinuation {
29
29
continuations[$0.id] =$0
30
30
}
31
31
```
32
32
33
+
The body closure is executed syncronously within the current isolation allowing actors to mutate their isolated state.
34
+
33
35
An optional cancellation handler is called when the task is cancelled. The handler is `@Sendable` and can be called at any time _after_ the body has completed.
While behaviour is identical, Swift 5 is unable to automatically inherit actor isolation through the new `#isolation` keyword ([SE-420](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0420-inheritance-of-actor-isolation.md)) so an `isolated` reference to the current actor must always be passed.
48
+
While behaviour is identical, Swift 5 is unable to inherit actor isolation through the new `#isolation` keyword ([SE-420](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0420-inheritance-of-actor-isolation.md)) so an `isolated` reference to the current actor must always be passed.
47
49
48
50
```swift
49
51
let val: String=awaitwithIdentifiableContinuation(isolation: self) {
0 commit comments