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

[QUESTION] How to run exposed async function #116

Open
puniaze opened this issue May 18, 2022 · 2 comments
Open

[QUESTION] How to run exposed async function #116

puniaze opened this issue May 18, 2022 · 2 comments

Comments

@puniaze
Copy link

puniaze commented May 18, 2022

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:

  • Running exposed method with await keyword - FAILED
  • Running it with promise - FAILED
  • Tried all above with execute_pending_job

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

@qwenger
Copy link
Collaborator

qwenger commented May 18, 2022

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
Copy link
Author

puniaze commented May 18, 2022

Thank you for quick reply @qwenger

That would be great if you can implement this feature.

Looking forward to see it in next releases

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

2 participants