swift
ef309162 - [Concurrency] Alternative Task API.

Commit
4 years ago
[Concurrency] Alternative Task API. The `Task` type has oscillated somewhat from being purely a namespace, to having instances that are used (albeit rarely), back to purely being a namespace that isn't used for all that many names. Many of the names that used to be on Task have already been moved out, e.g., for creating new detached tasks, creating new task groups, adding cancellation handlers, etc. Collapse `Task.Handle<Success, Failure>` into `Task<Success, Failure>`. `Task.Handle` is the type that is most frequently referenced in the concurrency library, so giving it the short name `Task` is most appropriate. Replace the top-level async/detach functions with a `Task` initializer and `Task.detached`, respectively. The `Task` type can still act as a namespace for static operations such as, e.g., `Task.isCancelled`. Do this with an extension of the form: extension Task where Success == Never, Failure == Never { ... } We've been accruing a number of compatibility shims. Move them all into their own source file, deprecate them, and make them always-emit-into-client so they don't have any ABI impact. (cherry picked from commit eda5b4daad8eccfbf19f3833793fec934d9dd9ed)
Author
Committer
Parents
Loading