-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow outputs to stay in progress mode after flush #3954
Merged
Merged
Conversation
This file contains 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
Adds a req(FALSE, cancelOutput="progress") which behaves similarly to cancelOutput=TRUE, but also keeps the output in .recalculating state even across flush cycles. This is called "persistent progress" and an output can leave this state when it is invalidated again and doesn't call req(FALSE, cancelOutput="progress") during that flush cycle. This will be useful for implementing long-running tasks that don't hold up the flush cycle, leaving sessions responsive to do other tasks.
Doesn't matter much but this is closer to the old behavior
The binding state management code is getting pretty creaky, but I don't think this is the straw that breaks the camel's back. |
wch
approved these changes
Dec 12, 2023
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Dec 13, 2023
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Dec 13, 2023
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Jan 12, 2024
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Jan 16, 2024
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Jan 17, 2024
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Jan 19, 2024
jcheng5
added a commit
to posit-dev/py-shiny
that referenced
this pull request
Jan 19, 2024
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.
Up until now, Shiny bound output enter progress mode (the
.recalculating
class is added) when their respective observer invalidates (source), and exit progress mode when that reactive flush cycle completes (source).This PR adds a
req(FALSE, cancelOutput="progress")
which behaves similarly tocancelOutput=TRUE
, but also keeps the output in.recalculating
state even across flush cycles. This is called "persistent progress" and an output can leave this state when it is invalidated again and doesn't callreq(FALSE, cancelOutput="progress")
during that flush cycle.This will be useful for implementing long-running tasks that don't hold up the flush cycle, leaving sessions responsive to do other tasks.
This feature is borderline internal (not that we can't commit to it, but because it's so low-level) so I'm not sure it needs a NEWS.md update--that can wait for the high-level feature we build on top of this, I think.