Permalink
Browse files

Adding a bit of documentation for the .on_no_data callback

  • Loading branch information...
1 parent 6650484 commit b8508063187eb4052a2bb0b61cd4c4837a46e1b0 @rud rud committed May 11, 2012
Showing with 7 additions and 0 deletions.
  1. +5 −0 README.markdown
  2. +2 −0 lib/twitter/json_stream.rb
View
@@ -32,6 +32,11 @@ JSON format only.
stream.on_max_reconnects do |timeout, retries|
# Something is wrong on your side. Send yourself an email.
end
+
+ stream.on_no_data do
+ # Twitter has stopped sending any data on the currently active
+ # connection, reconnecting is probably in order
+ end
}
@@ -90,6 +90,8 @@ def on_reconnect &block
@reconnect_callback = block
end
+ # Called when no data has been received for NO_DATA_TIMEOUT seconds.
+ # Reconnecting is probably in order as per the Twitter recommendations
def on_no_data &block
@no_data_callback = block
end

0 comments on commit b850806

Please sign in to comment.