# NOT RUN {
## Keep calling until it "returns" a number less than < 0.1
calls <- 0
number <- Inf
synchronise(async_until(
function() number < 0.1,
function() {
calls <<- calls + 1
number <<- runif(1)
}
))
calls
# }
Run the code above in your browser using DataLab