Repository navigation
Add Shiny background jobs - #5909
Merged
Merged
Conversation
melissa-barca
requested changes
Dec 21, 2019
| { | ||
| // typically the only way Shiny applications exit is by being stopped, so don't treat that | ||
| // as a failure | ||
| setJobState(job_, jobs::JobState::JobSucceeded); |
Contributor
There was a problem hiding this comment.
This is probably related to my above comment, but why not mark as cancelled?
Member
Author
There was a problem hiding this comment.
Aesthetics, mostly. Typically a Shiny process runs until you abort it. That means that as you run-edit-rerun an app, you will wind up with a big pile of aborted jobs. Having a big red Cancelled on every one of those jobs doesn't look nice (even though they technically were, indeed, cancelled) so we give them a nicer Succeeded treatment here.
- clean up whitespace - use canceled state if known
melissa-barca
approved these changes
Dec 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change makes it possible to run Shiny applications as background jobs. This is useful for a number of reasons:
Background mode is toggled via a new switch on the Run App menu. When the switch is set to Background Job, the Run App button launches a background job instead of sending a command to the R console.
A significant portion of this change is refactoring. Shiny jobs are a lot like R script jobs, so instead of building a parallel infrastructure for them, I created a more generic async R job manager and base class, from which Shiny and R Script jobs both inherit.
Closes #5190.