Skip to content
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

Invoke R callbacks in pure R #108

Open
jcheng5 opened this issue Sep 26, 2019 · 5 comments
Open

Invoke R callbacks in pure R #108

jcheng5 opened this issue Sep 26, 2019 · 5 comments

Comments

@jcheng5
Copy link
Member

jcheng5 commented Sep 26, 2019

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.

@atheriel
Copy link

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

@wch
Copy link
Member

wch commented Jun 25, 2020

@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.

@dselivanov
Copy link

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

@wch
Copy link
Member

wch commented Jun 29, 2020

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

@tzakharko
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants