-
Notifications
You must be signed in to change notification settings - Fork 16
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
bug: async bindings do not return result #22
Comments
I used the debug version of webui, I found out that The solution is making your functions return the wanted response instead of a promise. firstWindow.bind('second', async () => {
(async () => {
await new Promise(resolve => setTimeout(resolve, 100));
})();
return `${new Date()}`
}); You can still use promises calls between your functions and app, but the binded one with webui should return the response and not a promise object. This is because C code doesn't wait for the asynchronous... C standard does not have such a thing. |
Okay gotcha In your response then we should remove async keyword as well
Then I am using following approach:
Then executeDeno binding:
|
Yes, if that works for you!👍 |
To reproduce run following example:
As seen in example, running first function returns current date as expected, but unfortunately running second function returns empty string.
The text was updated successfully, but these errors were encountered: