Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to run shine() gadgets as RStudio jobs in the backround #44

Open
lianos opened this issue Apr 26, 2021 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@lianos
Copy link
Member

lianos commented Apr 26, 2021

Currently running shine() on a FacileAnalysisResult launches a shiny gadget that will block the R environment.

We should be able to run these gadgets a background jobs within RStudio so that we can have the shiny gadget running while enabling user to still interact with the R console.

@lianos lianos self-assigned this Apr 26, 2021
@lianos lianos added the enhancement New feature or request label Apr 26, 2021
@jonocarroll
Copy link
Collaborator

Some findings on this after a more recent look around...

It's possible to run a background job shiny app now.

That RStudio feature is only present when developing a standalone app, though. Programatic triggering seems a bit more difficult.

This guide is one approach, though it assumes one can re-write the server. An alternative is rstudioapi::jobRunScript() for which there is a nice wrapper in job(). That requires that one is calling runApp() rather than relying on the default action of shinyApp() but that's a small change.

Using an example in the README, I can trigger fdgeGadget() to be run without blocking the session with

job::job({shiny::runApp(FacileAnalysis::fdgeGadget(samples))})

however, this:

  • doesn't launch the browser, likely due to that being controlled by the FacileAnalysis code
  • doesn't show the gadgetTitleBar() with 'Cancel'/'Done' buttons since it's not detected as interactive() (and as such needs to be killed to stop it, rather than cleanly returning the results)
  • necessarily makes a copy of data in the workspace to be read back in by the spawned process - this might need some finessing.

I suspect these are minor adjustments required, but making background gadgets seems at least possible now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants