class Dynflow::ClockReference

Public Instance Methods

ping(who, time, with_what = nil, where = :<<) click to toggle source
# File lib/dynflow/clock.rb, line 123
def ping(who, time, with_what = nil, where = :<<)
  Type! time, Time, Numeric
  time  = Time.now + time if time.is_a? Numeric
  timer = Clock::Timer[who, time, with_what.nil? ? Algebrick::Types::None : Some[Object][with_what], where]
  # if self.ask!(:terminated?) # FIXME not thread safe
  #   Thread.new do
  #     sleep [timer.when - Time.now, 0].max
  #     timer.apply
  #   end
  # else
  self.tell([:add_timer, timer])
  # end
end