IOS

Difference between Task and async let

Task is for “fire-and-forget” use cases, which means you don’t need to handle the result when it’s done processing:

Task {
    await fetchData(for: user)
}

Async let is for parallel processing where you do have to process the results:

async let a = callA()
async let b = callB()
let results = await a + b
Standard

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.