rendezvous: minor refactoring

This commit is contained in:
Brian Warner 2016-05-05 18:21:06 -07:00
parent 8e664fdfcd
commit cfbd418898

View File

@ -45,14 +45,8 @@ class Channel:
def add_listener(self, ep):
self._listeners.add(ep)
db = self._db
for row in db.execute("SELECT * FROM `messages`"
" WHERE `appid`=? AND `channelid`=?"
" ORDER BY `when` ASC",
(self._appid, self._channelid)).fetchall():
if row["phase"] in (u"_allocate", u"_deallocate"):
continue
yield {"phase": row["phase"], "body": row["body"]}
return self.get_messages()
def remove_listener(self, ep):
self._listeners.discard(ep)