Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make asynchronous streaming threads daemons #268

Closed
wants to merge 1 commit into from

2 participants

@Aaron1011
Collaborator

I made streaming threads daemons when async is set to True.
See issue #70

@joshthecoder

I don't think this can be accepted without affecting existing code in a bad way. I would be more open to just exposing the thread object so developers can do this on their own if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 10, 2013
  1. @Aaron1011
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 tweepy/streaming.py
View
6 tweepy/streaming.py
@@ -166,7 +166,9 @@ def _read_loop(self, resp):
def _start(self, async):
self.running = True
if async:
- Thread(target=self._run).start()
+ thread = Thread(target=self._run)
+ thread.setDaemon(True)
+ thread.start()
else:
self._run()
@@ -207,7 +209,7 @@ def sample(self, count=None, async=False):
self.url += '&count=%s' % count
self._start(async)
- def filter(self, follow=None, track=None, async=False, locations=None,
+ def filter(self, follow=None, track=None, async=False, locations=None,
count = None, stall_warnings=False):
self.parameters = {}
self.headers['Content-type'] = "application/x-www-form-urlencoded"
Something went wrong with that request. Please try again.