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: