class Procrastinate::Proxy

A proxy class that will translate all method calls made on it to method calls inside their own process via the Scheduler.

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/procrastinate/proxy.rb, line 18
def method_missing(name, *args, &block)
  if respond_to? name
    task = Procrastinate::Task::Callable.new(
      lambda { @worker.send(name, *args, &block) })
    @scheduler.schedule(task)
    
    return task.result
  else
    super
  end
end
respond_to?(name) click to toggle source
# File lib/procrastinate/proxy.rb, line 14
def respond_to?(name)
  @worker.respond_to?(name)
end