Skip to content
Advertisement

How do I pass an async function to a thread target in Python?

I have the following code:

JavaScript

and I need to give it to a Thread as a target:

JavaScript

The error that I get is “some_callback is never awaited”.
Any ideas how can I solve this problem?

Advertisement

Answer

You can do it by adding function between to execute async:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement