Skip to content

Commit 1aec373

Browse files
authored
Update README.md
1 parent f5057ad commit 1aec373

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ let val: String? = await withIdentifiableContinuation { continuation in
4444

4545
> Note: The `onCancel:` handler is guaranteed to be called after the continuation body even if the task is already cancelled. Manually check `Task.isCancelled` before creating the continuation to prevent performing unrequired work.
4646
47-
## UnsafeContinuation
47+
## Checked/UnsafeContinuation
4848

49-
`withIdentifiableContinuation` internally uses a `CheckedContinunation`.
49+
`IdentifiableContinuation` internally stores either a `CheckedContinuation` or `UnsafeContinuation`.
5050

51-
To use `UnsafeContinuation` use the unsafe functions:
51+
`CheckedContinuation` is used by the default methods:
52+
53+
- `await withIdentifiableContinuation { .. }`
54+
- `try await withThrowingIdentifiableContinuation { ... }`
55+
56+
`UnsafeContinuation` is used by the unsafe methods:
5257

5358
- `await withIdentifiableUnsafeContinuation { .. }`
5459
- `try await withThrowingIdentifiableUnsafeContinuation { ... }`

0 commit comments

Comments
 (0)