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

Call a function at every ffi point #2236

Open
dev-ardi opened this issue Sep 12, 2024 · 0 comments
Open

Call a function at every ffi point #2236

dev-ardi opened this issue Sep 12, 2024 · 0 comments

Comments

@dev-ardi
Copy link

I'd love that we could setup an optional hook fn every time we enter (and exit?) an uniffi call. This would allow for things such as:

Automatic tracing spanning (#2210).

Custom behaviour on call. I don't have any specific thing in mind but I'm sure that this can be very useful.

And perhaps more importantly, the ability to use thread locals. Right now it's impossible because the caller could call us from any thread that they spawn, without the thread locals being setup.
This is important for things such as string interners, the ability to call tokio::spawn freely or anything that requires an init fn per thread.

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

1 participant