module Rage::Deferred
def self.wrap(instance, delay: nil, delay_until: nil)
- Example: Schedule an arbitrary method to be called in the background -
Parameters:
-
delay_until(Time, nil) -- the specific time when the task should be executed -
delay(Integer, nil) -- the delay in seconds before the task is executed -
instance(Object) -- the instance to wrap
def self.wrap(instance, delay: nil, delay_until: nil) Rage::Deferred::Proxy.new(instance, delay:, delay_until:) end