Promise

Published by onesixx on

https://rstudio.github.io/promises/
https://resources.rstudio.com/webinars/scaling-shiny-apps-with-async-programming-june-2018

Shiny async 는  future 와 promises packages를 통합하여 사용함으로써 얻을 수 있다.

  1. future 
    Background에서 실행하는 worker process에서 장시간의 연산을 수행하기 위해 future를 활용한다.
    동시에 그 동안에 다른 user의 요청을 처리할수 있도록 shiny process들은 free하게 남게둔다. 이것은 부하가 많이 걸리는 경우 더 좋은 응답속도을 가질 수 있다.
  2. promises 
    추가적인 연산을 발생하였을때 Shiny process에서 장시간의 background 연산의 각각의 결과를 처리하기 위해 promises를 활용한다.

The promises package (released 2018-04-13)

provides the actual API you’ll use to do async programming in R.
We implemented this as a separate package
so that other parts of the R community, (not just Shiny users), can take advantage of these techniques.
The promises package was inspired by the basic ideas of JavaScript promises, but also have significantly improved syntax and extensibility to make them work well with R and Shiny.
Currently, promises is most useful
when used with the future package by Henrik Bengtsson.

Categories: R-Shiny

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x