Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1.     @gen.coroutine
  2.     def _notify_posts(self, posts):
  3.         """ Usa o broadcast para notificar os novos posts a todos os usuários
  4.        que estão conectados ao canal público do feed. """
  5.         self.log('posts to notify: %d' % len(posts))
  6.         for post in reversed(posts):
  7.             try:
  8.                 self.log('notifying...');
  9.                 yield self.backend.notify(post)
  10.                 self.log('notified!');
  11.             except Exception, e:
  12.                 self.log('Não foi possível notificar o post %s. %s' % (post.id, str(e)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement