#Non blocking websocket listening

1 messages · Page 1 of 1 (latest)

prime frigate
#

Hi! i want to listen to another websocket (not the discord gateway websocket) but without blocking the rest of the bot. im not really into asyncio and async so i had a hard time figuring out how to get this to work.

sharp basin
#

Your best bet is to use aiohttp with its .ws_connect() method, or you want to use httpx, however, I do not know how to use that lib.

jolly citrus
#

You can use aiohttp, as it should already be installed

modern silo
#

wait we can create websockets within a websocket without blocking the whole process!?

sharp basin
#

what...

modern silo
#

httpx is better

sharp basin
#

they have their advantages. This is not the channel to discuss this.

jolly citrus
#

Been down that hole for hikari already