class Celluloid::Actor::Sleeper - celluloid-0.16.0 Documentation

# class Celluloid::Actor::Sleeper

### Public Class Methods

new(timers, interval) click to toggle source

    # File lib/celluloid/actor.rb, line 258
    def initialize(timers, interval)
      @timers = timers
      @interval = interval
    end

### Public Instance Methods

before_suspend(task) click to toggle source

    # File lib/celluloid/actor.rb, line 263
    def before_suspend(task)
      @timers.after(@interval) { task.resume }
    end

wait() click to toggle source

    # File lib/celluloid/actor.rb, line 267
    def wait
      Kernel.sleep(@interval)
    end