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 propagate option to knit_exit() #1810

Merged
merged 4 commits into from
Jan 25, 2021
Merged

Conversation

davidchall
Copy link
Contributor

When calling knit_exit() from within a child document, this child document stops rendering and the parent document continues to render. There are certainly circumstances where this is the desired behavior. However, there are also cases where I'd prefer the entire document to stop rendering immediately.

This PR adds a propagate option to knit_exit(). This indicates whether the early termination signal should be propagated from child documents up to the top-level document. The default value (FALSE) retains existing behavior.

@davidchall
Copy link
Contributor Author

Hi @yihui, is there anything else I need to do to help this get merged?

@CLAassistant
Copy link

CLAassistant commented Sep 22, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late response! I'd like the propagation to be the default behavior. I'm okay with making this breaking change, since I feel it makes a lot more sense for knit_exit() to exit the whole process. Thank you!

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just simplified the PR and made the breaking change. Will merge after tests pass. Thanks!

@yihui yihui merged commit 222325a into yihui:master Jan 25, 2021
@davidchall
Copy link
Contributor Author

@yihui - thanks for reviewing!

I quite liked the ability to choose the behavior with the propagate argument though... The previous behavior could support fault-tolerant documents, when this was desirable.

yihui added a commit that referenced this pull request Jan 26, 2021
@yihui
Copy link
Owner

yihui commented Jan 26, 2021

Okay. I just added the argument back. Thanks again!

@davidchall
Copy link
Contributor Author

Thanks!

@davidchall davidchall deleted the propagate-exit branch January 26, 2021 03:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants