File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,20 @@ explicitly) `consuming`.
334
334
335
335
## Future directions
336
336
337
- ### ` disconnected ` types
338
-
339
- TODO
337
+ ### ` Disconnected ` types
338
+
339
+ ` transferring ` requires parameter and result values to be in a disconnected
340
+ region at the function boundary, but there is no way to preserve that a value
341
+ is in a disconnected region through stored properties, collections, function
342
+ calls, etc. To preserve that a value is in a disconnected region through the
343
+ type system, we could introduce a ` Disconnected ` type into the Concurrency
344
+ library. The ` Disconnected ` type would suppress copying via ` ~Copyable ` , it
345
+ would conform to ` Sendable ` , constructing a ` Disconnected ` instance would
346
+ require the value it wraps to be in a disconnected region, and a value of type
347
+ ` Disconnected ` can never be merged into another isolation region.
348
+
349
+ This would enable important patterns that take a ` transferring T ` parameter,
350
+ store the value in a collection of ` Disconnected<T> ` , and later remove values
351
+ from the collection and return them as ` transferring T ` results. This would
352
+ allow some ` AsyncSequence ` types to return non-` Sendable ` buffered elements as
353
+ ` transferring ` without resorting to unsafe opt-outs in the implementation.
You can’t perform that action at this time.
0 commit comments