News for hackers. Stuff that matters.
Re:How async/await works internally in Swift by bsaul on Friday September 29, 2023 @05:15AM (#37701172)
My main pattern of concurrency is scheduling a computation made of a serie of asynchronous steps. I want this computation to be cancellable, and i want to schedule them keeping them in order.

Basically NSOperation scheduled to a non-current operation queue, where the operation itself is made of async calls.

What would be the recommended approach for doing that with swift concurrency ?

Re:How async/await works internally in Swift by saagarjha on Friday September 29, 2023 @07:41AM (#37702280)
Probably write your own queue
Re:How async/await works internally in Swift by bsaul on Friday September 29, 2023 @01:54PM (#37707862)
sure, how ?

One actor per queue, then one actor per operation ?

Re:How async/await works internally in Swift by saagarjha on Saturday September 30, 2023 @03:59AM (#37713507)
Depends on the exact semantics you want. What are you looking for?
Re:How async/await works internally in Swift by mattiemass on Friday September 29, 2023 @09:22AM (#37703812)
I have found myself, many times, in exactly the same situation. I think a concurrency-compatible queue is basically essential for many kinds of pretty boring situations. I made one here, and it look a lot like an OperationQueue. But it also points to another implementation I found recently that is certainly different, but also might be interesting.

https://github.com/mattmassicotte/Queue

Re:How async/await works internally in Swift by bsaul on Friday September 29, 2023 @01:53PM (#37707845)
thanks, yes i saw that link in the video linked in OP. I am absolutely dumbounded swift concurrency and actors don't offer a trivial solution to that problem.