diff --git a/DESCRIPTION b/DESCRIPTION index 7e416811..78a3ac98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,7 @@ Description: In computationally demanding analysis projects, 'clustermq' by Schubert (2019) ), and 'batchtools' by Lang, Bischel, and Surmann (2017) . -Version: 0.9.3.9000 +Version: 0.9.3.9001 License: MIT + file LICENSE URL: https://wlandau.github.io/crew/, https://github.com/wlandau/crew BugReports: https://github.com/wlandau/crew/issues diff --git a/NEWS.md b/NEWS.md index c1b5a401..b5a67b1f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ -# crew 0.9.3.9000 (development) - +# crew 0.9.3.9001 (development) +* Do not use extended tasks in Shiny vignette. # crew 0.9.3 diff --git a/vignettes/shiny.Rmd b/vignettes/shiny.Rmd index a2c56975..a66515f9 100644 --- a/vignettes/shiny.Rmd +++ b/vignettes/shiny.Rmd @@ -174,12 +174,14 @@ The previous app feels choppy because it only refreshes every half second. Using The revised app has two changes. First, it takes `mirai` task returned by `controller$push()` and turns it into a special [`promise`](https://rstudio.github.io/promises/). This [`promise`](https://rstudio.github.io/promises/) updates the coin flip counts as soon as the flip finishes. ```r -observeEvent(input$button, { - for (task in seq_len(1000)) { +observeEvent( + input$button, + replicate( + 1000, controller$push(flip_coin(), data = list(flip_coin = flip_coin)) %...>% collect_flips(controller, flips) - } -}) + ) +) ``` The `collect_flips()` function collects all the finished flips and updates the flip counts. @@ -229,12 +231,14 @@ server <- function(input, output, session) { flips <- reactiveValues(heads = 0, tails = 0, total = 0) # Flip a batch of coins when the button is pressed. - observeEvent(input$button, { - for (task in seq_len(1000)) { + observeEvent( + input$button, + replicate( + 1000, controller$push(flip_coin(), data = list(flip_coin = flip_coin)) %...>% collect_flips(controller, flips) - } - }) + ) + ) # Print time and flip counts. output$results <- renderText({