mattmassicotte / ConcurrencyRecipes

Practical solutions to problems with Swift Concurrency
BSD 3-Clause "New" or "Revised" License
1.07k stars 33 forks source link

Add second solution to protocol problem. #2

Closed samalone closed 7 months ago

mattmassicotte commented 7 months ago

Thanks so much for this! This is a great suggestion. I did modify it slightly, just to remove the introduction of the actor concept, so it stays closer to the original problem. It also reminded me to highlight another potentially serious hazard - making a function async requires changes at all call sites.