Closed aleclarson closed 6 years ago
They are two different things, a do async
can be used within a function to create concurrent code.
let fn = async fn () {
let value = do {
await sleep(100)
42
}
assert(value is 42)
}
let fn = async fn () {
let value = do async {
await sleep(100)
42
}
assert(value is Async<42>)
}
You're determining with block the await
belongs to
Oh okay. Very cool. Maybe a comparison of both should be in the readme?
Need more docs about Async
too! :)
Do blocks should inherit
async
modifier from their function context, becausedo
blocks are not functions themselves.