0

I have this code:

await asyncio.wait_for(wait, timeout=60)

my wait function is:

def wait():
    while True:
        if qiwiapi.check(comment):
            break
        sleep(2)

It gives me

An asyncio.Future, a coroutine or an awaitable is required

How can I make it work? I need a timeout for a non async function.

mkrieger1
  • 14,486
  • 4
  • 43
  • 54
  • Alternatively, https://stackoverflow.com/questions/41063331/how-to-use-asyncio-with-existing-blocking-library – mkrieger1 Mar 07 '22 at 10:25

0 Answers0