Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make asynchronous streaming threads daemons #268

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions tweepy/streaming.py
Expand Up @@ -166,7 +166,9 @@ def _read_loop(self, resp):
def _start(self, async): def _start(self, async):
self.running = True self.running = True
if async: if async:
Thread(target=self._run).start() thread = Thread(target=self._run)
thread.setDaemon(True)
thread.start()
else: else:
self._run() self._run()


Expand Down Expand Up @@ -207,7 +209,7 @@ def sample(self, count=None, async=False):
self.url += '&count=%s' % count self.url += '&count=%s' % count
self._start(async) 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): count = None, stall_warnings=False):
self.parameters = {} self.parameters = {}
self.headers['Content-type'] = "application/x-www-form-urlencoded" self.headers['Content-type'] = "application/x-www-form-urlencoded"
Expand Down