hypebright / async_shiny

Examples to implement asynchronous programming in Shiny ✨
MIT License
58 stars 7 forks source link
callr coroutines promises shiny shiny-r

Asynchronous programming in Shiny

This repo contains examples to implement asynchronous programming in Shiny ✨

Async programming can sound very daunting but by providing specific Shiny examples the aim is to speed up the learning curve.

About asynchronous programming

Asynchronous programming allows for the execution of multiple tasks concurrently, improving the performance and responsiveness of Shiny applications. Traditional synchronous programming executes tasks sequentially, which can result in slower response times and blocked resources. By default, a Shiny applications runs on a single-threaded synchronous R session.

Asynchronous programming in Shiny can be achieved through various packages that provide mechanisms for running code concurrently, such as promises, callr, coro, mirai and crew. These packages allow developers to write more efficient and responsive code.

You can also use promises in combination with ExtendedTask from Shiny version 1.8.1.

Examples

YouTube 🎥

I have a couple of videos on YouTube about async programming in Shiny:

Future plans

The plan is to add more examples and tutorials on how to implement asynchronous programming in Shiny. Keep an eye on this repository for updates.

Contributors 📣

Do you want to add examples to this repo? That's awesome 👏 . I'm welcoming all support!