In the last post, we sketched out the high level rules of the async/await inference. This post will show how it works under the hood for a concrete example that reads two files concurrently, and then concatenates the result:
readTwo(system: System, file1: String, file2: String): String {
let pair = system.tasks.concurrently(
{system.files.readText(file1)},
{system.files.readText(file2)}
)
pair.first + pair.second
}
Continue reading: https://www.ahnfelt.net/async-await-inference-in-firefly-part-2/
Top comments (0)