Skip to content

Commit

Permalink
adds 'multi-session' to oanda_studio()
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Sep 12, 2024
1 parent 7e110c1 commit 3eca88d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ichimoku 1.5.4.9000 (development)

#### Updates:
#### New features:

* Internal performance enhancements.
* `oanda_studio()` adds option 'multi.session' to facilitate multiple sessions to be used with the Shiny app (for example more than one browser page).

# ichimoku 1.5.4

Expand Down
8 changes: 7 additions & 1 deletion R/oanda.R
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ oanda_chart <- function(instrument,
#' @param new.process [default FALSE] if TRUE, will start the shiny session in a
#' new R process, unblocking the current process and allowing continued use
#' of the R console.
#' @param multi.session [default FALSE] if TRUE, does not automatically close
#' the Shiny app when an individual session (web browser page) disconnects.
#' Use with caution in conjunction with \sQuote{new.process} as the Shiny
#' app continues to run in the background process.
#' @param ... additional arguments passed along to \code{\link{ichimoku}} for
#' calculating the ichimoku cloud, \code{\link{autoplot}} to set chart
#' parameters, or the 'options' argument of \code{shiny::shinyApp()}.
Expand Down Expand Up @@ -572,6 +576,7 @@ oanda_studio <- function(instrument = "USD_JPY",
server,
apikey,
new.process = FALSE,
multi.session = FALSE,
...,
launch.browser = TRUE,
periods = c(9L, 26L, 52L)) {
Expand Down Expand Up @@ -768,7 +773,8 @@ oanda_studio <- function(instrument = "USD_JPY",
output$savedata <- downloadHandler(filename = function() sprintf("%s_%s_%s.rda", input$instrument, input$granularity, input$price),
content = function(file) archive(pdata(), file))

session$onSessionEnded(stopApp)
if (!multi.session) session$onSessionEnded(stopApp)

}

app <- shinyApp(ui = ui, server = server, options = list(launch.browser = launch.browser, ...))
Expand Down
6 changes: 6 additions & 0 deletions man/oanda_studio.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3eca88d

Please sign in to comment.