You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
coro::async() inherits the properties of promises (https://rstudio.github.io/promises). By default they are scheduled by a top-level event loop that runs when R is idle so only that loop and the tasks it manages (promises including ones created by async functions) have access to values.
In practice this means you can only access values from an async function only from another async context by using await().
Using a modified example from {coro}, it is unclear how to access the value of the function. Here we return
n
after the async function has completed.Running this results in a promise (expected) however, trying to get the value via
n$finally()
results in an error.At present it seems that using
async()
is intended only for functions with side effects. Is that correct?The text was updated successfully, but these errors were encountered: