later icon indicating copy to clipboard operation
later copied to clipboard

Invoke R callbacks in pure R

Open jcheng5 opened this issue 4 years ago • 5 comments

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.

jcheng5 avatar Sep 26 '19 17:09 jcheng5

I'm very strongly interested in this, since I have a package that issues warnings via later() from a C background thread.

atheriel avatar Jun 25 '20 15:06 atheriel

@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 avatar Jun 25 '20 15:06 wch

@wch I don't see callbacks-r on github.

dselivanov avatar Jun 28 '20 10:06 dselivanov

@dselivanov Sorry, I forgot to push the branch before. It's there now.

wch avatar Jun 29 '20 17:06 wch

I wanted to ask whether this change is still planned? Not being able to handle conditions is painful...

tzakharko avatar Jul 03 '21 08:07 tzakharko