zephyr_mirror: Run both processes within a single application.

(imported from commit 8f379a682ede7076ddcbe046dee5be6592a5bbd9)
This commit is contained in:
Tim Abbott
2012-10-12 17:19:49 -04:00
parent 437b25fe44
commit 367f6c0a56
2 changed files with 17 additions and 10 deletions

View File

@@ -61,7 +61,7 @@ class HumbugAPI():
request["streams"] = simplejson.dumps(streams)
return self.do_api_query(request, "/api/v1/subscribe")
def call_on_each_message(self, callback, idle_call = None, options = {}):
def call_on_each_message(self, callback, options = {}):
max_message_id = None
while True:
if max_message_id is not None:
@@ -82,6 +82,3 @@ class HumbugAPI():
for message in sorted(res['messages'], key=lambda x: int(x["id"])):
max_message_id = max(max_message_id, int(message["id"]))
callback(message)
if idle_call is not None:
idle_call()