How tweetstream gem in rails handle stall_warnings?

264 views Asked by At

I am using the wonderful tweetstream gem ( https://github.com/intridea/tweetstream ) for rails to use the streaming twitter api. However, i read in the twitter documentation that we can set the param "stall_warnings" to true in order to receive warning messages from twitter when the client is in danger of being disconnected, that tells how much the current client queue is full.( https://dev.twitter.com/docs/streaming-apis/parameters#stall_warnings )

How can i use this feature with the tweetstream gem ? I do not see anything in the tweetstream doc about it.

Thanks a lot in advance.

1

There are 1 answers

0
Bobby Martinez On

looking through the code on github:

https://github.com/intridea/tweetstream/blob/master/lib/tweetstream/client.rb

It might be the on_no_data_received method.

"Set a Proc to be run when no data is received from the server and a stall occurs. Twitter defines this to be 90 seconds."

It doesn't explicitly say it's the same stall_warning from Twitter, but it does say this will proc when "a stall occurs".