When using the websocket-client library, in python, is it possible for the on_message function to be a coroutine ?
I have the following code below:
async def on_message(ws, message):
await get_balance() # runs an aiohttp get request
ws = websocket.WebSocketApp(data_feed,on_message=on_message)
ws.run_forever()
This gives me the error
RuntimeWarning: coroutine 'on_message' was never awaited
callback(self, *args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Am I missing something?
Thanks in advance