From e4999c06219c120957f4b4b4e10cb69f1d7e43b4 Mon Sep 17 00:00:00 2001 From: Paul van der Linden Date: Mon, 16 Feb 2015 20:59:20 +0000 Subject: [PATCH] send out keep alive --- tweepy/streaming.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 956f29b..677e3f6 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -79,6 +79,10 @@ class StreamListener(object): else: logging.error("Unknown message type: " + str(raw_data)) + def keep_alive(self): + """Called when a keep-alive arrived""" + return + def on_status(self, status): """Called when a new status arrives""" return @@ -293,7 +297,7 @@ class Stream(object): while True: line = buf.read_line().strip() if not line: - pass # keep-alive new lines are expected + self.listener.keep_alive() # keep-alive new lines are expected elif line.isdigit(): length = int(line) break -- 2.25.1