Avatar
John McCallさんが以前こんなコメント残してましたね👀 There are a lot of basic questions about @asyncHandler that we're not confident about right now:
  • The spelling doesn't seem great.
  • Async handlers make it really easy to accidentally break structured concurrency, since the handler task is detached. Perhaps the tasks shouldn't be fully detached and need some other form of structure.
  • Async handlers currently detach immediately, which is nice for certain use cases; however, the goal was originally to support the needs of synchronous UI handlers, which almost certainly want to do an initial segment of their work synchronously.
  • Relatedly, actor-isolated async handlers become non-actor-isolated externally, which doesn't really mesh with even allowing the preferred semantics for synchronous UI handlers. https://forums.swift.org/t/new-concurrency-api-not-available-in-latest-toolchain/47389/13
(edited)
There are a lot of basic questions about @asyncHandler that we're not confident about right now: The spelling doesn't seem great. Async handlers make it really easy to accidentally break structured concurrency, since the handler task is detached. Perhaps the tasks shouldn't be fully detached and need some other form of structure. Async handle...