Open
Description
When there are nested progressors, only the first one is listened to. Any progress conditions signaled by nested progressors are ignored. Here's an example of nested progressors:
library(progressr)
handlers(handler_progress(format=":spin :message [:bar] :percent"))
foo <- function(n) {
p <- progressor(n)
lapply(seq_len(n), FUN = function(ii) {
p(sprintf("foo(%d)", ii))
Sys.sleep(0.5)
})
}
bar <- function(n) {
p <- progressor(n)
lapply(seq_len(n), FUN = function(ii) {
foo(n = 5)
p(sprintf("bar(%d)", ii))
})
}
Calling
y <- bar(10)
will only report on bar()
updates.
However, we could make use of those conditions by doing an amount=0
update, i.e. to communicate "still alive", which may for instance update a "spinner".
The code that drops/ignore nested progressors is in: