Permalink
Browse files

allow access to the periodic timer

  • Loading branch information...
1 parent 0454771 commit 9046fc5f11dada1c0b6a924d348b1fa7cf32a413 @stve stve committed Sep 26, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/tweetstream/client.rb
View
5 lib/tweetstream/client.rb
@@ -23,6 +23,7 @@ class Client
# @private
attr_accessor *Configuration::VALID_OPTIONS_KEYS
+ attr_accessor :timer
# Creates a new API
def initialize(options={})
@@ -308,9 +309,9 @@ def start(path, query_parameters = {}, &block) #:nodoc:
EventMachine::run {
if @on_interval_proc.is_a?(Proc)
- timer = @on_interval_time || Configuration::DEFAULT_TIMER_INTERVAL
+ interval = @on_interval_time || Configuration::DEFAULT_TIMER_INTERVAL
proc = @on_interval_proc
- EM.add_periodic_timer(timer, &proc)
+ @timer = EM.add_periodic_timer(interval, &proc)
end
@stream = Twitter::JSONStream.connect(stream_params)

0 comments on commit 9046fc5

Please sign in to comment.