Permalink
Browse files

Add optional on_inited callback

  • Loading branch information...
1 parent 4b46bb6 commit eccefb3b508ccd098528da69d151cabdb06d3ab7 @antono antono committed with voloko Oct 25, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/twitter/json_stream.rb
@@ -69,6 +69,7 @@ def initialize options = {}
@af_last_reconnect = nil
@reconnect_retries = 0
@immediate_reconnect = false
+ @on_inited_callback = options.delete(:on_inited)
@proxy = URI.parse(options[:proxy]) if options[:proxy]
end
@@ -122,6 +123,7 @@ def connection_completed
def post_init
reset_state
+ @on_inited_callback.call if @on_inited_callback
end
protected

0 comments on commit eccefb3

Please sign in to comment.