Closed wlandau closed 9 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
fc9a564
) 100.00% compared to head (54687b8
) 100.00%.:exclamation: Current head 54687b8 differs from pull request most recent head e288a26. Consider uploading reports for the commit e288a26 to get more accurate results
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I am having trouble getting an app with promises to work.
After searching more, I think the cause of (2) may be that promises unblock sessions from other sessions, but they cannot (yet) make tasks asynchronous within the same session. I would probably need to open multiple browser windows for the same app to see any asynchronicity.
Update: crew
0.9.0 is now on CRAN, and it supports the {promises} integration in https://wlandau.github.io/crew/articles/promises.html.
Prework
Related GitHub issues and pull requests
Summary
This PR adds a new
promise()
method which allows controllers and controller groups to create promises. A full tutorial is in the newpromises.Rmd
vignette. Thanks @jcheng5 for the idea.I am happy with how this initial implementation came together, so I will merge when the automated checks succeed. But there are a couple follow-ups:
crew
promise useslater::later()
for local asynchronicity because right now it is the only convenient option I know about. The loop should be efficient because it pretty much just polls an NNG condition variable, but a non-polling approach would be more responsive and kinder to the CPU. Maybe {nanonext} and {promises} can work together on this somehow.promises.Rmd
vignette, but I am having trouble getting an app with promises to work. The reprex below shows what I mean. The app has button to click to run a 2-second task in afuture
promise, and it has a clock that updates every tenth of a second. I expect the clock to keep running no matter what is going on inside the promise, but whenever I click the button, the clock pauses until the task completes. Maybe this is an obvious failure mode and I am missing something about how promises work in Shiny.