rstudio / promises

A promise library for R
https://rstudio.github.io/promises
Other
201 stars 19 forks source link

Quitting out of browser prompt in a then() causes promises to stop working #5

Open wch opened 6 years ago

wch commented 6 years ago

To reproduce, run the following. When the Browse prompt appears, press Q. Then run the second code block; it will only print 1 and 2.

promise(function(resolve, reject) {
  cat("1\n", file=stderr())
  resolve("OK")
  cat("2\n", file=stderr())
}) %...>% then(function(value) {
  cat("3: ", value, "\n", file=stderr())
  # When you get to this prompt, type Q to exit
  browser()
  cat("4\n", file=stderr())
})

# When you run this code after the code above, it only prints 1 and 2.
promise(function(resolve, reject) {
  cat("1\n", file=stderr())
  resolve("OK")
  cat("2\n", file=stderr())
}) %...>% then(function(value) {
  cat("3: ", value, "\n", file=stderr())
  cat("4\n", file=stderr())
})
wch commented 6 years ago

This might be caused by r-lib/later#12.

wch commented 6 years ago

According to the discussion in RcppCore/Rcpp#753, this may not be fixable.