stop_mirai {mirai} | R Documentation |
Stops a ‘mirai’ if still in progress, causing it to resolve immediately to an ‘errorValue’ 20 (Operation canceled).
stop_mirai(aio)
aio |
a ‘mirai’ object. |
Forces the ‘mirai’ to resolve immediately. Has no effect if the ‘mirai’ has already resolved.
If cancellation was successful, the value at $data
will be an
‘errorValue’ 20 (Operation canceled). Note that in such a case,
the ‘mirai’ has been aborted and the value not retrieved - but any
ongoing evaluation in the daemon process will continue to completion and
is not interrupted.
Invisible NULL.
if (interactive()) {
# Only run examples in interactive R sessions
m <- mirai(Sys.sleep(n), n = 5)
stop_mirai(m)
m$data
}