Repository navigation
Conversation
…tudio#291. I've added a `timeout` argument to showDialog() and callRemote() as described below, and added logic to callFun() to propagate a named `timeout` argument to callRemote() if running as a job. Revised function signatures: showDialog(title, message, url = "", timeout = 10) callFun(fname, ...) callRemote(call, frame, timeout = 10) Original function signatures: showDialog(title, message, url = "") callFun(fname, ...) callRemote(call, frame) To avoid adding arguments to callFun(), I make an object of list(...) and check whether it has a `timeout` element, then callRemote() with two or three arguments as needed.
|
My use case is a custom knitr output format which automates interaction with a website using library(selenider). Because knitting runs as a "job", I experience the timeout problem described in this issue. As a simplified test case, create a file called If you Then try rerunning the job (green circle arrow in the top right of the Background Jobs pane) and click OK within 5 seconds. This will succeed. With the code in this pull request, one can extend the timeout and have more time to respond to the dialog: It's worth noting that in all cases the dialog will sit there forever, not interrupting after the timeout has passed. |
|
Thanks for the PR! Some thoughts on potential alternatives:
This would also allow us to avoid the need to pull the "timeout" argument out of |
|
Superceded by #303; nonetheless I appreciate your taking the time to put this together! |
I've added a
timeoutargument to showDialog() and callRemote() as described below, and added logic to callFun() to propagate a namedtimeoutargument to callRemote() if running as a job.devtools::check() reports no errors, warnings or notes.
@kevinushey, please have a look. I also added argument descriptions for the roxygen2 comment to callRemote() to please devtools::check(). That documentation is written with the help of ChatGTP, but agrees with my limited understanding of the serialization and sys.call() wizardry.
Revised function signatures:
showDialog(title, message, url = "", timeout = 10) callFun(fname, ...)
callRemote(call, frame, timeout = 10)
Original function signatures:
showDialog(title, message, url = "")
callFun(fname, ...)
callRemote(call, frame)
To avoid adding arguments to callFun(), I make an object of list(...) and check whether it has a
timeoutelement, then callRemote() with two or three arguments as needed.