Explicit support for heartbeat handling
Yet another crack at the stream iterator.
Now we explicitly track timeouts and heartbeat timeouts separately. Regular timeouts produce `Timeout` tokens (dicts). Heartbeat timeouts produce `HeartbeatTimeout` and StopIteration if iterated again. This is a solid fix for issue #202.
If the stream is set to use `timeout=None, block=False`, then we yield only data or `None`. If `timeout` is set to a number, we yield data or `Timeout` tokens, never `None`. If we are set to `block=True` then we yield only data.
Also: improve the documentation and remove some code weirdness.
Also: make the example stream program highly configurable to test every bizarre combination from the command line.
-
from __future__ import print_function
import webbrowser
access. Copy the PIN number that appears on the next page and paste or
type it here:
""")
- oauth_url = ('http://api.twitter.com/oauth/authorize?oauth_token=' +
+ oauth_url = ('https://api.twitter.com/oauth/authorize?oauth_token=' +
oauth_token)
print("Opening: %s\n" % oauth_url)