Basically this flag should have 4 states {NULL when starting the app, "running" when pushing START button, "queue" when waiting the end of the previous computation, "done" when the computation is done}.
I've made a few lines of code to illustrate the behaviour but of course it does not work as expected.
Hi @olivier6088, if you have long running computations, you may want to leverage shiny's new asynchronous programming support which allows you to perform these expensive computations in a background process, and thus, free up your main shiny-server R process to do other things while those expensive computation(s) run. In this context, your queue notification may no longer relevant/informative, since you could use this infrastructure to instantly spin-off multiple jobs.
Getting started with async is difficult, but it may be worth your trouble
A relevant challenge that async introduces is communication between the background thread(s) and the main R shiny-server process, which is needed if you need to do something like update a progress bar for the computation running in the background thread. The ipc package process some nice tools for this, though: