Browse Source

format code style

format code style
pull/116/head
larry.liu 8 years ago
committed by GitHub
parent
commit
fd5a176745
  1. 6
      socketio/asyncio_redis_manager.py

6
socketio/asyncio_redis_manager.py

@ -67,13 +67,15 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover
async def _publish(self, data): async def _publish(self, data):
if self.pub is None: if self.pub is None:
self.pub = await aioredis.create_redis((self.host, self.port), self.pub = await aioredis.create_redis((self.host, self.port),
db=self.db, password=self.password) db=self.db,
password=self.password)
return await self.pub.publish(self.channel, pickle.dumps(data)) return await self.pub.publish(self.channel, pickle.dumps(data))
async def _listen(self): async def _listen(self):
if self.sub is None: if self.sub is None:
self.sub = await aioredis.create_redis((self.host, self.port), self.sub = await aioredis.create_redis((self.host, self.port),
db=self.db, password=self.password) db=self.db,
password=self.password)
self.ch = (await self.sub.subscribe(self.channel))[0] self.ch = (await self.sub.subscribe(self.channel))[0]
while True: while True:
return await self.ch.get() return await self.ch.get()

Loading…
Cancel
Save