I was inspired by some recent conversations to put together a few recipes to some Swift concurrency problems I've run into. I'd be really curious to hear about problems you've run into!

https://github.com/mattmassicotte/ConcurrencyRecipes

GitHub - mattmassicotte/ConcurrencyRecipes: Practical solutions to problems with Swift Concurrency

Practical solutions to problems with Swift Concurrency - mattmassicotte/ConcurrencyRecipes

GitHub
@mattiem oh my god this is gold! We are doing a major migration to concurrency at work, and for the past week I have been doing some work combining old-fashioned delegate API with async/await and actors. I will definitely add something once it comes up (and am sure it will)

@esnahel Well great!

I tried to keep it pretty low on opinions. But, two things I think are really important: strict warnings on! And, keep your use of Task to an absolute minimum.

@mattiem ohh, interesting in the second one, the Task, can you share why?
@esnahel Unstructured concurrency (Task) has two small problems: it requires manual cancellation and does not handy priority boosting. And it also has one very big problem: it provides no ordering guarantees. This isn’t always an issue, but it is both subtle and very different from other systems you may be used to.

@mattiem
I somehow missed your comment! But I saw it now when I came to reply with my own take haha πŸ˜…

https://x.com/esnssr/status/1733956456255291571?s=46

Eslam Nasser 🍦 (@esnssr) on X

As I am learning more about Tasks, I am realizing how error prone using them can be. From non-catching errors by default, to a lot possible way to keep the task running forever, it feels like you have to really be careful using them.

X (formerly Twitter)
@esnahel Yup they are necessary, but you have to be extremely careful with them!