Rodrigo Cardoso Buske

@Robuske
2 Followers
36 Following
16 Posts
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
Hello world