/usr/share/doc/ruby-eventmachine/examples/ex_tick_loop_array.rb is in ruby-eventmachine 0.12.10-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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
|