async let vs TaskGroup
A banking app's home screen has to fetch independent account, card, and notification data at the same time. Between async let and TaskGroup, which would you pick, and on what basis?
A banking app's home screen has to fetch independent account, card, and notification data at the same time. Between async let and TaskGroup, which would you pick, and on what basis?
If the number and types of requests are fixed in code, like the three for accounts, cards, and notifications, three lines of async let are right; if the count is decided at runtime, like fetching a balance for each of n accounts, use a TaskGroup. The criterion is whether the number of children is known at compile time.
ConcurrencyShort answerBasics
When a screen appears you call three APIs in parallel, profile, feed, and notifications…
#async-let #taskgroup
ConcurrencyMultiple choiceAdvanced
Which of the following statements about structured concurrency (async let, TaskGroup) are…
#async-let #taskgroup
ConcurrencyMultiple choiceIntro
In Swift Concurrency, if fetchProfile() and fetchFeed() each take 1 second, which…
#async-let
ConcurrencyShort answerBasics
Write a Combine pipeline that sends two different network requests (user profile, account…
#async-let