I am studying using rubygem twitter-stream with EventMachine to track and record tweets. I’m kind of new to everything that happens in programming. How can I determine if any processing that I do in my event loop will affect it? Is there an easy way to check?
EventMachine has a method EventMachine::Queue.sizethat allows you to look into the current queue and get an idea of how big it is.
EventMachine::Queue.size
add_periodic_timer()In this case, you can also get the size of the queue and print it.
add_periodic_timer()
, . , .
. 1 , 1 , , , .
@last = Time.now.to_f EM.add_periodic_timer(1) do puts "LATENCY: #{Time.now.to_f - @last}" @last = Time.now.to_f end