Here's the original signature, including the underscored attribute that is omitted from generated documentation:
@discardableResult
public init(
priority: TaskPriority? = nil,
@_inheritActorContext operation: sending @escaping @isolated(any) () async -> Success
)
I'd love to apply three simplifications:
- Make
@_inheritActorContext
the default behavior for an@isolated(any)
function - Make use of the ideas that the proposal which added
@isolated(any)
notes and have it implysending
- Exploit the fact that I cannot think of a way that a synchronous function could do useful work with an asynchronous closure argument unless it is allowed to escape
2 might be cheating, and 3 could just be impossible and/or a bad idea. I haven't thought about either too hard. But, regardless, it's interesting to imagine.
@discardableResult
public init(
priority: TaskPriority? = nil,
operation: @isolated(any) () async -> Success
)