Permalink
Browse files

Make reactor running optional

  • Loading branch information...
1 parent a54559e commit 7eb8fffaa714387b0ec0e6c399f7c8c79030b63a @rhymes committed May 31, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 pinder/streaming.py
View
5 pinder/streaming.py
@@ -46,7 +46,7 @@ def connectionLost(self, reason):
d.addErrback(self.user_errback)
d.errback(DefaultException(reason.getErrorMessage()))
-def start(username, password, room_id, callback, errback):
+def start(username, password, room_id, callback, errback, start_reactor=False):
auth_header = 'Basic ' + base64.b64encode("%s:%s" % (username, password)).strip()
url = 'https://streaming.campfirenow.com/room/%s/live.json' % room_id
headers = Headers({
@@ -58,4 +58,5 @@ def start(username, password, room_id, callback, errback):
d = agent.request('GET', url, headers, None)
d.addCallback(_get_response, callback, errback)
d.addBoth(_shutdown, errback)
- reactor.run()
+ if start_reactor:
+ reactor.run()

0 comments on commit 7eb8fff

Please sign in to comment.