Class Timers::Group
In: lib/timers/group.rb
Parent: Object

A collection of timers which may fire at different times

Methods

after   cancel   continue   current_offset   delay   every   fire   new   now_and_after   now_and_every   pause   resume   wait   wait_interval  

Included Modules

Enumerable

Attributes

events  [R]  Scheduled events:
paused_timers  [R]  Paused timers:
timers  [R]  Active timers:

Public Class methods

Public Instance methods

Call the given block after the given interval. The first argument will be the time at which the group was asked to fire timers for.

Cancel all timers.

continue()

Alias for resume

The group‘s current time.

Delay all timers.

Call the given block periodically at the given interval. The first argument will be the time at which the group was asked to fire timers for.

Fire all timers that are ready.

Call the given block immediately, and then after the given interval. The first argument will be the time at which the group was asked to fire timers for.

Call the given block immediately, and then periodically at the given interval. The first argument will be the time at which the group was asked to fire timers for.

Pause all timers.

Resume all timers.

Wait for the next timer and fire it. Can take a block, which should behave like sleep(n), except that n may be nil (sleep forever) or a negative number (fire immediately after return).

Interval to wait until when the next timer will fire.

  • nil: no timers
  • -ve: timers expired already
  • 0: timers ready to fire
  • +ve: timers waiting to fire

[Validate]