PetterS / quickjs

Thin Python wrapper of https://bellard.org/quickjs/
https://github.com/bellard/QuickJS
MIT License
175 stars 19 forks source link

[QUESTION] How to run exposed async function #116

Open puniaze opened 2 years ago

puniaze commented 2 years ago

Hi, @PetterS

I want to know if there is a way to expose and call async python method from quickjs

I exposed my simple async function via add_callable and tried to run it in JS. I am getting error that coroutine is not awaited.

Problem here that I could not find a way to do it in JS.

I tried:

Maybe I am doing something wrong, can you please suggest a workaround?

qwenger commented 2 years ago

Hi,

Exposing async Python functions to JS is currently not supported. I'm currently starting to work on a v2 of this package and the feasibility of that feature will get considered. Though I'm not a priori sure whether it is doable.

puniaze commented 2 years ago

Thank you for quick reply @qwenger

That would be great if you can implement this feature.

Looking forward to see it in next releases