update on certain user

3 views
Skip to first unread message

arief nur andono

unread,
Mar 2, 2011, 3:36:19 AM3/2/11
to Tornado Web Server
in any example code (chat)...tornado give response to all users
connected.

how to make tornado could response on certain user

class MessageUpdatesHandler(BaseHandler, MessageMixin):
@tornado.web.authenticated
@tornado.web.asynchronous
def post(self):
cursor = self.get_argument("cursor", None)

self.wait_for_messages(self.async_callback(self.on_new_messages),
cursor=cursor)

def on_new_messages(self, messages):
# Closed client connection
if self.request.connection.stream.closed():
return
self.finish(dict(messages=messages))

which code should I change so it could reply on certain user?
Reply all
Reply to author
Forward
0 new messages