-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Async functions are not supported #41
Comments
Any news now that this tool uses uniffi 0.25? I've noticed that uniffi-bindgen-cs currently generates invalid stubs for async methods, making it impossible to use for existing codebases with uniffi annotations. |
Async function are not a priority for us, so I haven't had the time to look into this. Though generating invalid code in presence of async is not acceptable and I missed this somehow. A PR would be welcome, it shouldn't be difficult to generate "empty" or no return stubs that throw an exception when called 😉 |
Can I expect to see any developments on this? Need async and external types. |
I have no plans to work on this in the near future. |
I have tried to implement async functions for 0.24, but ran into some issues.
The performance is inadequate. Trying to await 1000 functions that only sleep for 100ms and return, takes around 1 second. This equates to around 1ms per async function call. I'm completely dumbfounded why this happens. I don't have time right now to try and profile this.
Returning objects from functions is not working in some cases. The C# marshaller complains that
SafeHandle
cannot be marshalled. This happens when future callback is being invoked. A solution could be to rework the code to useIntPtr
instead ofSafeHandle
.With uniffi 0.25 just around the corner, it seems like async functions have had a significant rework. I'm hoping that the changes in 0.25 might automatically solve at least one of these issues. As this is not a priority for us right now, I'm postponing async functions for later.
The text was updated successfully, but these errors were encountered: