You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
408 B
19 lines
408 B
import logging
|
|
import datetime
|
|
from redis import StrictRedis
|
|
from tornado import web, websocket, escape
|
|
|
|
r = StrictRedis(db=1)
|
|
|
|
logger = logging.getLogger('handlers')
|
|
|
|
|
|
class ChatHandler(websocket.WebSocketHandler):
|
|
|
|
waiters = set()
|
|
|
|
def open(self, *args, **kwargs):
|
|
self.chnl = kwargs.get('channel', 'main')
|
|
self.waiters.add((self.chn1, self))
|
|
self.chnl_key = 'channels:{}'
|
|
|
|
|