-
Notifications
You must be signed in to change notification settings - Fork 18
Implements wait_for()
#190
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
base: main
Are you sure you want to change the base?
Conversation
|
After putting together this PR, I came across the version of |
|
This looks like a great start @shikokuchuo! Have you reviewed the chromote implementation? Currently this PR resembles various implementations we've used in package testing, which is a much more controlled environment. For a public, robust and final solution in promises we should be very convinced about the features we do or do not need from the chromote implementation. |
|
Thanks @gadenbuie I hadn't actually reviewed chromote as I was under the impression that it wasn't an R-level implementation, let alone one based on promises! Luckily it seems we all converge on the same approach. Chromote additionally has a lot of code to handle interrupts and my gut reaction is that this isn't necessary in the general case, but this should become apparent when I actually write the tests! |
I think this gets at what I meant by the difference between the implementations we've used in testing and a user-facing API. My inclination is that in user-facing code we'd want, or might even need, to support interrupts and other features that users would need and expect in an interactive session. |
|
Yes. Both @gadenbuie and I would like to have the chromote version with interrupt support. Thank you, @shikokuchuo ! |
|
Just so we're on the same page, the The version in chromote seems to be to support the interrupt cancelling the underlying promise itself, and is specifically used together with later_with_interrupt() which is a non-exported function internal to chromote. |
Thanks for clarifying, that's great to hear.
I'm happy to wait to see what you find out when you write the tests, but it'd be helpful in the end if this PR description can include a summary of the chromote code and an explanation of why we don't need to follow the same path here. It'd also be useful to explain whether we can replace chromote's version with promises' solution without breaking backcompat. |
Closes #142, closes #48.
As discussed in today's Shiny meeting. This PR takes an approach that works universally for any type of promise.
I need time to ponder
(i) the function name, (ii) whether it should throw on rejection, and (iii)whether it is correct/optimal to setall = FALSEforlater::run_now().To add:
In the meantime, feel free to comment @schloerke @gadenbuie @cpsievert.