Last chance! 50% off unlimited learning
Sale ends in
Query whether an Aio or Aio value remains unresolved. Unlike
call_aio
, this function does not wait for completion.
unresolved(aio)
An Aio (object of class 'sendAio' or 'recvAio'), or Aio value
stored in $result
, $raw
or $data
as the case may be.
Logical TRUE or FALSE.
Returns TRUE for unresolved Aios or Aio values, FALSE otherwise.
Suitable for use in control flow statements such as while
or if
.
Note: querying resolution may cause a previously unresolved Aio to resolve.
# NOT RUN {
s1 <- socket("pair", listen = "inproc://nanonext")
aio <- send_aio(s1, "test", timeout = 100)
while (unresolved(aio)) {
# do stuff before checking resolution again
cat("unresolved\n")
s2 <- socket("pair", dial = "inproc://nanonext")
Sys.sleep(0.01)
}
unresolved(aio)
close(s1)
close(s2)
# }
Run the code above in your browser using DataLab