Sha256: 6ffde59239fca1ed953bcc7593b51c26be94c89cdd70d3e5485b4826593cd261

Contents?: true

Size: 221 Bytes

Versions: 141

Compression:

Stored size: 221 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

EM.run do
  array = (1..100).to_a

  tickloop = EM.tick_loop do
    if array.empty?
      :stop
    else
      puts array.shift
    end
  end

  tickloop.on_stop { EM.stop }
end

Version data entries

141 entries across 138 versions & 12 rubygems

Version Path
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.0.0/gems/eventmachine-1.2.7/examples/old/ex_tick_loop_array.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/3.1.0/gems/eventmachine-1.2.7/examples/old/ex_tick_loop_array.rb
devcycle-ruby-server-sdk-1.1.0 examples/sinatra/vendor/bundle/ruby/2.6.0/gems/eventmachine-1.2.7/examples/old/ex_tick_loop_array.rb
eventmachine-mkroman-1.3.0.dev.1 examples/old/ex_tick_loop_array.rb
wj_eventmachine-1.3.2 examples/old/ex_tick_loop_array.rb
wj_eventmachine-1.3.1 examples/old/ex_tick_loop_array.rb
wj_eventmachine-1.3.0.dev.1 examples/old/ex_tick_loop_array.rb
sensu-em-2.7.0-java examples/old/ex_tick_loop_array.rb
eventmachine-1.2.7-java examples/old/ex_tick_loop_array.rb
eventmachine-1.2.7-x64-mingw32 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.7-x86-mingw32 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.7 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.6-x64-mingw32 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.6-x86-mingw32 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.6-java examples/old/ex_tick_loop_array.rb
eventmachine-1.2.6 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.5-x86-mingw32 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.5-x64-mingw32 examples/old/ex_tick_loop_array.rb
eventmachine-1.2.5-java examples/old/ex_tick_loop_array.rb
eventmachine-1.2.5 examples/old/ex_tick_loop_array.rb