We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e7e518 commit 11b6bd0Copy full SHA for 11b6bd0
stdlib/public/Concurrency/Task.swift
@@ -95,16 +95,18 @@ import Swift
95
/// struct Work: Sendable {}
96
///
97
/// actor Worker {
98
-/// var work: Task<Work, Never>?
+/// var work: Task<Void, Never>?
99
+/// var result: Work?
100
101
/// deinit {
-///
102
/// print("deinit")
103
/// }
104
105
/// func start() {
106
/// work = Task {
107
-/// return Work()
+/// try? await Task.sleep(for: .seconds(3))
108
+/// self.work = Work() // we captured self
109
+/// // but as the task completes, this reference is released
110
111
112
0 commit comments