later
later copied to clipboard
Invoke R callbacks in pure R
Consider rewriting execCallback
to not invoke R-based callbacks with our own C/C++ code on the call stack. This would remove our invocation of R_TopLevelExec which causes issues with withCallingHandlers
(like expect_warning
).
We could rewrite execCallback
to only take the callback in C++, and return control to R which will invoke it. There will be some challenge here to maintain the do/while loop logic without inadvertently introducing changes.
I'm very strongly interested in this, since I have a package that issues warnings via later()
from a C background thread.
@atheriel I started work on this several months ago but I didn't have time to finish. Unfortunately I won't have time to get to it probably for the rest of the year.
The branch is callbacks-r
. If you're interested in picking it up, I could sketch out how I was thinking of implementing it.
@wch I don't see callbacks-r
on github.
@dselivanov Sorry, I forgot to push the branch before. It's there now.
I wanted to ask whether this change is still planned? Not being able to handle conditions is painful...