func fetchData(_ id: Int) async throws -> String {
try await Task.sleep(for: .seconds(1))
return "\(id)"
}
let result1 = try await fetchData(1)
let result2 = try await fetchData(2)
let result3 = try await fetchData(3)
En el código anterior, las peticiones se ejecutan de arriba a abajo, una después de otra, como si fuera código...
🛡️ VERIFIED CYBER INTELLIGENCE ID: #3189589