mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Sync to changes in promise. run_now aggressively in serviceApp.
This commit is contained in:
@@ -177,8 +177,8 @@ drawPlot <- function(name, session, func, width, height, pixelratio, res, ...) {
|
||||
|
||||
p1 <- promise::with_promise_domain(domain, {
|
||||
p2 <- promise::resolved(func())
|
||||
p2 <- promise::then(p2, function(value, visible) {
|
||||
if (visible) {
|
||||
p2 <- promise::then(p2, function(value, .visible) {
|
||||
if (.visible) {
|
||||
# A modified version of print.ggplot which returns the built ggplot object
|
||||
# as well as the gtable grob. This overrides the ggplot::print.ggplot
|
||||
# method, but only within the context of renderPlot. The reason this needs
|
||||
|
||||
@@ -451,7 +451,7 @@ runloop <- function() {
|
||||
# Run an application that was created by \code{\link{startApp}}. This
|
||||
# function should normally be called in a \code{while(TRUE)} loop.
|
||||
serviceApp <- function() {
|
||||
if (timerCallbacks$executeElapsed()) {
|
||||
if (later::run_now() || timerCallbacks$executeElapsed()) {
|
||||
for (shinysession in appsByToken$values()) {
|
||||
shinysession$manageHiddenOutputs()
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ renderPrint <- function(expr, env = parent.frame(), quoted = FALSE,
|
||||
function(err) { cat(file=stderr(), "ERROR", err$message) }
|
||||
)
|
||||
})
|
||||
p1 <- finally(p1, ~close(domain$conn))
|
||||
p1 <- promise::finally(p1, ~close(domain$conn))
|
||||
p1
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ renderPrint <- function(expr, env = parent.frame(), quoted = FALSE,
|
||||
createRenderPrintPromiseDomain <- function(width) {
|
||||
f <- file()
|
||||
|
||||
new_promise_domain(
|
||||
promise::new_promise_domain(
|
||||
wrapOnFulfilled = function(onFulfilled) {
|
||||
force(onFulfilled)
|
||||
function(...) {
|
||||
|
||||
Reference in New Issue
Block a user