Passing values to an Task/Actor in serial manner

Hi, I have a really simple code, which send some values from synchronous func to async func. Values received in async func are not in order. func sendValues() { for i in 0..<1000 { Task { await count(i) } } } func count(_ value: Int) async { print(value) // values received NOT in order } As far as I know unstructured Tasks are scheduled on global concurrent executor so may execute in any order. But why async...

Swift Forums
@Robuske Depends! Ordering guarantees for Task has been improved. There are now situations where capturing order may not be needed. But I don’t think it’s a bad idea!
@mattiem can you expand (or send a reference) on how have they improved?
SE-0431: @isolated(any) Function Types

Swift uses its type system to model concurrency. An integral part of that system is functions. Swift’s ability to model how functions can behave has expanded pretty dramatically lately. Except, there’s a substantial gap. We’ve seen many new facilities for expressing concurrency in function declarations.

massicotte.org
@mattiem I will read it later, thanks