class Soda::Worker::Options

Attributes

klass[R]
options[R]

Public Class Methods

new(klass, options) click to toggle source
# File lib/soda/worker.rb, line 4
def initialize(klass, options)
  @klass    = klass
  @options  = options
end

Public Instance Methods

perform_async(*args) click to toggle source
# File lib/soda/worker.rb, line 15
def perform_async(*args)
  perform_in(0, *args)
end
perform_at(delay, *args)
Alias for: perform_in
perform_in(delay, *args) click to toggle source
# File lib/soda/worker.rb, line 19
def perform_in(delay, *args)
  tap do
    client = Soda::Client.new
    client.push(
      options.merge(
        "delay" => delay,
        "klass" => klass,
        "args"  => args,
      ),
    )
  end
end
Also aliased as: perform_at
set(opts = {}) click to toggle source
# File lib/soda/worker.rb, line 9
def set(opts = {})
  tap do
    options.merge!(opts)
  end
end