RuntimeWarning: coroutine 'callback' was never awaited

154 views
Skip to first unread message

Hasanul Islam

unread,
Jul 11, 2021, 2:52:19 PM7/11/21
to Pika
Hi,
I would like to call a `async` function from callback of consumer.
How an I do that?

async do_something_async():
         pass

async def callback(ch, method, properties, body):
         await do_something_async()

channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True)
Reply all
Reply to author
Forward
0 new messages