@fxi/shiny-cluster
v0.0.8
Published
Launch a Shiny app in multiple workers using node js
Downloads
15
Maintainers
Readme
shinyCluster
shinyCluster
is a simple Node.js module for launching a single R shiny application in a cluster of workers and keep track of sessions.
This is an experimental project. Please send me a feedback if you find this script useful.
Other ways
- For production: use the official shiny-server or shiny-server pro.
- Load balancing: A Shiny-app Serves as Shiny-server Load Balancer
Usage
Prerequisite
Install
npm install @fxi/shiny-cluster --save
Example
Launch the default app
var shinyCluster= require('@fxi/shiny-cluster');
/**
* Launch a simple shiny app ( located in `./example` ),
* using 3 workers and
* listen on port 3456
*/
shinyCluster.run({
path : "./example/app.R" // path to directory of shiny app or app.R file
concurency : 3,
port : 3456
});
### Launch your app
var shinyCluster= require('@fxi/shiny-cluster');
/**
* Launch your shiny app
* located here `/home/john/myShinyApp/app.R`,
* using 10 workers and
* listen on port 3434
*/
shinyCluster.run({
path : '/home/john/myShinyApp' ,
concurency : 10,
port : 3434
});
Contribution
yes please !
Change logs
0.0.6 -> 0.0.8
- wait on shiny app to be ready using stderr output (not really clean)
- setup config: timeoutConnect, timeoutListen, nTry
- set option for host
0.0.5 -> 0.0.6
- wait on shiny port to be available using net.connect
- better error handling
0.0.2 -> 0.0.5
- paths issues
- better example
0.0.1 -> 0.0.2
- build a node module
- use sticky-cluster
- simplify everything