-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hello,
Nice R package that I love to use now !
I would like to use coro in a R script, but when I run the example https://coro.r-lib.org/reference/async.html with Rscript, it ends immediatly.
How can I wait the termination of the promise before R exits ?
The only ( and dirty ) solution I found is :
# mycoroScript.R
# see https://coro.r-lib.org/reference/async.html
promises::promise_all( async_count_down(5), async_count_up(5) ) %>% then( function(value) {
writeLines("q( status = 0)", f <- file("/tmp/fifo", raw=T) ); close(f)
}
To run it from bash :
$ ( mkfifo /tmp/fifo; cat mycoroScript.R; cat /tmp/fifo) | R --interactive --no-save
Thanks for your advice !
Metadata
Metadata
Assignees
Labels
No labels