0

I’m making a Twitter application using Python and Twython. I’m using the Twitter’s Stream API. It seems to work fine, but when the internet connection its down for a time, the stream cannot reconnect when the connection returns.

The idea is that if the connection if down for a half of hour, the stream can connect when the connection it’s OK. There is a way to do it?

  • I used Twython for few time and I never saw anything similar to a reconnection feature. I'm pretty sure you have to test it by yourself, catching the error and reconnecting. Anyway, reconnecting is nearly a normal procedure for many applications. – Maximiliano Rios Jan 17 '14 at 01:40
  • If you check the Twython Github there're some requests for a reconnect feature, no implemented of course. – Maximiliano Rios Jan 17 '14 at 01:46
  • Oh, well, I suppose that I can make a function that checks if the self.connected var is set to True, and if not, reconnects the stream. Do you know if when the stream is disconnected this var is set to False? – user2957482 Jan 17 '14 at 02:40
  • I only tested certain things and yes, it works that way, but I'm not sure if you could get a clean reconnection. It worths to try anyway! I think the idea of Twython was good but the owner of the project didn't have more time and quit to add more features. It would be nice to continue it. – Maximiliano Rios Jan 17 '14 at 02:44
  • It's actively maintained anyway but some features have been there for a long time without improvement. – Maximiliano Rios Jan 17 '14 at 02:46
  • Many thanks! I will try to create this function to reconnect (I think that I need destroy and create another object to do it clearly). Greetings. – user2957482 Jan 17 '14 at 02:51
  • Might be you could send the code and I can test it and add it as an example of reconnection to GitHub later. – Maximiliano Rios Jan 17 '14 at 02:56

0 Answers0