module Concussion::Persist

Public Instance Methods

later(time, *args) click to toggle source
# File lib/concussion/persist.rb, line 11
def later(time, *args)
  time = Time.now if time < Time.now
  seconds = (time - Time.now).to_i
  @guid = SecureRandom.uuid
  Concussion.persist(self.class, @guid, time, *args)

  after(seconds) { perform(*args) }
end
perform(*args) click to toggle source
Calls superclass method
# File lib/concussion/persist.rb, line 3
def perform(*args)
  begin
    super *args
  ensure
    Concussion.retire @guid
  end
end