Query whether a mirai or mirai value remains unresolved. Unlike call_mirai, this function does not wait for completion.

unresolved(aio)

Arguments

aio

A 'mirai' or mirai value stored in $data (mirai are also aio objects).

Value

Logical TRUE or FALSE.

Details

Returns TRUE for unresolved mirai or mirai values, FALSE otherwise.

Suitable for use in control flow statements such as while or if.

Note: querying resolution may cause a previously unresolved mirai to resolve.

Examples

if (interactive()) {
# Only run examples in interactive R sessions

m <- mirai(Sys.sleep(0.1))
unresolved(m)
Sys.sleep(0.5)
unresolved(m)

}