From: Paul van der Linden Date: Mon, 16 Feb 2015 20:59:20 +0000 (+0000) Subject: send out keep alive X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e4999c06219c120957f4b4b4e10cb69f1d7e43b4;p=tweepy.git send out keep alive --- 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