-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconnect on hangup or timeut #201
base: master
Are you sure you want to change the base?
Reconnect on hangup or timeut #201
Conversation
-rename stream to stream_aux -stream_aux returns whether or not to reconnect -add new stream function to handle reconnects
@stephenwithav Do your changes help with the Hangup errors? |
@ManasB the changes will automatically reconnect after receiving a Hangup message if |
Hi @stephenwithav, thanks for contribution. |
I think it will attempt to reconnect upon a Hangup or Timeout (if the setting is enabled) With regards to preventing a Hangup/Timeout, if it isn't an error/disconnect on the client's side then there's not much to prevent? I'm familiarizing myself with rainbowstream's code. Thank you for developing this program! I think having a 'Reconnect on Hangup/Timeout' is useful, though you may run into Twitter's connection rate limit. Now that I think of it, I guess that my errors were related to hitting Twitter's rate limit. |
Yes reaching rate limit was my concern. Automatically reconnecting can lead to rate limit easily and in theory you will be blocked for a while before you can try again. So best practice maybe limit (for example, 3 times) of reconnecting. |
Can you provide a link to Twitter's rate limit documentation? This code simply reconnects when a Hangup message is received--or there's a heartbeat timeout. |
https://dev.twitter.com/streaming/overview/connecting Yes this wraps calling TwitterStream inside a |
Thank you, @dtvd. The docs suggest delaying reconnect attempts in increments of 250ms up to 16s, which shouldn't be difficult. |
@dtvd if you're okay with the PR suggested in #199 (comment) ... here you go. 😃
rainbowstreamをありがとうございました.