From adb459e65745f517181541dc2ebf4aca697ad6d6 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 25 Feb 2021 05:25:50 -0500 Subject: [PATCH] changed channels --- server.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 899a95a..9248186 100644 --- a/server.py +++ b/server.py @@ -58,6 +58,12 @@ asyncio.get_event_loop().run_forever() from aioredis.pubsub import Receiver from aioredis.abc import AbcChannel +CHANNELS = [ + 'vocode', + 'spawn', + 'testing', +] + print('defining server', flush=True) @@ -87,7 +93,10 @@ async def server(websocket, path): redis = await aioredis.create_redis_pool('redis://localhost') - await redis.subscribe(mpsc.channel('channel:1'), mpsc.channel('channel:testing'), mpsc.channel('testing')) + #await redis.subscribe(mpsc.channel('channel:1'), mpsc.channel('channel:testing'), mpsc.channel('testing')) + channels = [mpsc.channel(ch) for ch in CHANNELS] + + await redis.subscribe(*channels) print('starting websocket server', flush=True) try: