Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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-concurrent operation queue, where the operation itself is made of async calls.

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



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


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.


Probably write your own queue


sure, how ?

One actor per queue, then one actor per operation ?


Depends on the exact semantics you want. What are you looking for?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: