Is there a way to run regular tasks async, like we can for HTTP request with ncurl_aio
#109
|
Hi :) I'm just wondering if there is an easy way to run a bunch or "regular" R tasks async using I can use lapply(urls, \(url) nanonext::ncurl_aio(url))I can then wait on the results later. Is there a similar way to do this with nanonext but for regular R expressions ? jobs <- lapply(x, \(i) nanonext::__???__(i))
finished <- nanonext::call_aio(jobs)
## or
finished <- nanonext::collect_aio(jobs)Side question: What is the difference between |
Replies: 1 comment 4 replies
|
What you're looking for is the
Yes. |
What you're looking for is the
miraipackage (https://github.com/r-lib/mirai).That runs things in other processes, rather than threads, but it is also the only way as R is not multi-threaded.
Yes.
collect_aio(x)is marginally more efficient thancall_aio(x)$data.