forked from rstudio/shinyapps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
100 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ Collate: | |
'deployments.R' | ||
'applications.R' | ||
'terminate.R' | ||
'setInstances.R' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#' Set Application Instances | ||
#' | ||
#' Set the number of parallel instances used for an application deployed to | ||
#' ShinyApps. | ||
#' @param appName Name of application | ||
#' @param instances Number of parallel instances to be used for the application | ||
#' @param account Account name. If a single account is registered on the system | ||
#' then this parameter can be omitted. | ||
#' @param quiet Request that no status information be printed to the console | ||
#' @examples | ||
#' \dontrun{ | ||
#' | ||
#' # specify that an application use 3 instances | ||
#' setInstances("myapp" instances = 3) | ||
#' } | ||
#' @export | ||
setInstances <- function(appName, instances, account = NULL, quiet = FALSE) { | ||
|
||
# define task | ||
taskDef <- list() | ||
taskDef$beginStatus <- "Setting application instances" | ||
taskDef$endStatus <- "Application instances deployed" | ||
taskDef$action <- function(lucid, application) { | ||
lucid$scaleApplication(application$id, instances) | ||
} | ||
|
||
# perform it | ||
applicationTask(taskDef, appName, account, quiet) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
\name{setInstances} | ||
\alias{setInstances} | ||
\title{Set Application Instances} | ||
\usage{ | ||
setInstances(appName, instances, account = NULL, | ||
quiet = FALSE) | ||
} | ||
\arguments{ | ||
\item{appName}{Name of application} | ||
|
||
\item{instances}{Number of parallel instances to be used | ||
for the application} | ||
|
||
\item{account}{Account name. If a single account is | ||
registered on the system then this parameter can be | ||
omitted.} | ||
|
||
\item{quiet}{Request that no status information be | ||
printed to the console} | ||
} | ||
\description{ | ||
Set the number of parallel instances used for an | ||
application deployed to ShinyApps. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
|
||
# specify that an application use 3 instances | ||
setInstances("myapp" instances = 3) | ||
} | ||
} | ||
|