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をありがとうございました.