2018-02-26

Scaling Shiny apps with async programming

Share

One persistent challenge with developing Shiny apps for live deployment, has been the R language runtime's single-threaded nature. Because of this, a given Shiny app process can only do one thing at a time: if it is fitting a model for one client, it cannot simultaneously serve up a CSV download for another client. Asynchronous programming offers a way to offload certain classes of long-running operations from the main R thread, such that Shiny apps can remain responsive. The next major release of Shiny will include deep support for asynchronous programming via promises, inspired by the JavaScript abstraction of the same name, but with significant enhancements to integrate seamlessly with Shiny's reactive constructs and to allow app authors to write code that looks mostly like idiomatic R. Programming with these promises has its own learning curve, but the payoff can be huge if your app has a significant bottleneck.

View Slides

Speakers

portrait of Joe Cheng on tan colored background

Joe Cheng

Chief Technology Officer at Posit, PBC
Joe Cheng is the CTO and first employee at Posit, PBC (formerly known as RStudio), where he helped create the RStudio IDE and Shiny web framework, along with countless complementary tools and packages.