rendezvous: minor refactoring
This commit is contained in:
parent
8e664fdfcd
commit
cfbd418898
|
@ -45,14 +45,8 @@ class Channel:
|
||||||
|
|
||||||
def add_listener(self, ep):
|
def add_listener(self, ep):
|
||||||
self._listeners.add(ep)
|
self._listeners.add(ep)
|
||||||
db = self._db
|
return self.get_messages()
|
||||||
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"]}
|
|
||||||
def remove_listener(self, ep):
|
def remove_listener(self, ep):
|
||||||
self._listeners.discard(ep)
|
self._listeners.discard(ep)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user