- def __init__(
- self, domain="stream.twitter.com", secure=True, auth=None,
- api_version='1.1', block=True, timeout=None):
- uriparts = ()
- uriparts += (str(api_version),)
-
- if block:
- if timeout:
- call_cls = TwitterStreamCallWithTimeout
- else:
- call_cls = TwitterStreamCall
- else:
- call_cls = TwitterStreamCallNonBlocking
+ def __init__(self, domain="stream.twitter.com", secure=True, auth=None,
+ api_version='1.1', block=True, timeout=None,
+ heartbeat_timeout=90.0):
+ uriparts = (str(api_version),)
+
+ class TwitterStreamCall(TwitterCall):
+ def _handle_response(self, req, uri, arg_data, _timeout=None):
+ return handle_stream_response(
+ req, uri, arg_data, block,
+ _timeout or timeout, heartbeat_timeout)