Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fxi/shinyCluster
Node.js module to launch a R Shiny app in multiple workers
https://github.com/fxi/shinyCluster
Last synced: 18 days ago
JSON representation
Node.js module to launch a R Shiny app in multiple workers
- Host: GitHub
- URL: https://github.com/fxi/shinyCluster
- Owner: fxi
- Created: 2015-07-09T08:54:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-21T06:51:31.000Z (over 6 years ago)
- Last Synced: 2024-06-11T20:19:20.494Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 35
- Watchers: 8
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - fxi/shinyCluster - Node.js module to launch a R Shiny app in multiple workers (JavaScript)
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](https://www.rstudio.com/products/shiny-server-pro/).
* Load balancing: [A Shiny-app Serves as Shiny-server Load Balancer](http://withr.me/a-shiny-app-serves-as-shiny-server-load-balancer/)# Usage
## Prerequisite
* [nodejs + npm](https://nodejs.org/download/)
* [R](http://www.r-project.org/)
* [R package shiny](https://cran.r-project.org/web/packages/shiny/index.html)## Install
```{sh}
npm install @fxi/shiny-cluster --save
```## Example
### Launch the default app
```{js}
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
```{js}
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 host0.0.5 -> 0.0.6
- wait on shiny port to be available using net.connect
- better error handling0.0.2 -> 0.0.5
- paths issues
- better example0.0.1 -> 0.0.2
- build a node module
- use sticky-cluster
- simplify everything