Avatar
今は async {} -> Taskのinit detach -> Task.detach に変わってますね(だいぶ議論になってますが) https://github.com/apple/swift-evolution/blob/main/proposals/0304-structured-concurrency.md#unstructured-tasks-1 https://github.com/apple/swift/pull/37495 違いとしてはざっくりと
  • Taskのinit -> 呼び出し側のmeta情報やpriorityなどを引き継ぐ
  • Task.detach -> ↑を引き継がない
なんですかね https://github.com/apple/swift-evolution/blob/main/proposals/0304-structured-concurrency.md#context-inheritance 僕はasyncHandlerの代わりだと思ってます。 We might need to create new tasks whose lifetime is not bound to the creating task, for example in order to fire-and-forget some operation or to initiate asynchronous work from synchronous code
(edited)
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 na...
This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - apple/swift-evolution