Module: Resque::Plugins::ChainedStatus::ClassOverrides

Defined in:
lib/resque_manager/overrides/resque_status/chained_status.rb

Instance Method Summary collapse

Instance Method Details

#enqueue_to(queue, klass, options = {}) ⇒ Object

OVERRIDE to grab the uuid out of options so it can be chained to the calling worker instead of creating a new uuid.

Raises:

  • (ArgumentError)


31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/resque_manager/overrides/resque_status/chained_status.rb', line 31

def enqueue_to(queue, klass, options = {})
  #tie this job to the status of the calling job
  opts = HashWithIndifferentAccess.new(options)
  raise ArgumentError, "You must supply a :uuid attribute in your call to create." unless opts['uuid']
  uuid = opts['uuid']
  if Resque.enqueue_to(queue, klass, uuid, options)
    uuid
  else
    Resque::Plugins::Status::Hash.remove(uuid)
    nil
  end
end