Commit 5e068137 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Implement StreamListener.on_connect callback.

parent 247b02f6
......@@ -22,6 +22,15 @@ class StreamListener(object):
def __init__(self, api=None):
self.api = api or API()
def on_connect(self):
"""Called once connected to streaming server.
This will be invoked once a successful response
is received from the server. Allows the listener
to perform some work prior to entering the read loop.
def on_data(self, data):
"""Called when raw data is received from connection.
......@@ -114,6 +123,7 @@ class Stream(object):
error_counter = 0
except timeout:
if self.listener.on_timeout() == False:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment