later icon indicating copy to clipboard operation
later copied to clipboard

Warn/error when callbacks call run_now()?

Open wch opened this issue 6 years ago • 0 comments

Currently it's possible for a callback to call run_now(). Perhaps later should warn/error when this happens? This is related to rstudio/httpuv#148.

In this example, the second run_now() makes the callbacks run, but the same thing happens if that's removed and the execution of callbacks is triggered by R's input handler.

library(later)
{
  later(function() {
    cat("1")
    later(function() cat("2"))
    cat("3")
    run_now()
    cat("4")
  })
  cat("5")
  run_now()
  cat("6")
}
#> 513246

wch avatar Jun 06 '18 15:06 wch