lib/celluloid/actor.rb in celluloid-0.9.0 vs lib/celluloid/actor.rb in celluloid-0.9.1

- old
+ new

@@ -182,9 +182,16 @@ @timers.add(interval) do Task.new(:timer) { yield }.resume end end + # Schedule a block to run at the given time + def every(interval) + @timers.add(interval, true) do + Task.new(:timer) { yield }.resume + end + end + # Sleep for the given amount of time def sleep(interval) if Celluloid.exclusive? Kernel.sleep(interval) else