ruby-on-railstweetstream

Tweetstream stops working


I'm connecting to the twitter API using the tweetstream gem as shown here. It works fine, but when I stop and restart the stream as I'm changing the way I handle the stream, after about 5 restarts over 2 hours or so the stream stops giving me updates, and the on_reconnect event keeps happening every 30 seconds or so.

I'm thinking this is because this triggers rate limiting, or because the previous connections are not killed before starting the new one. Is there a proper way to do this?


Solution

  • I'm not exactly sure as to the cause of my problem, but this is what I've done: