Class: Resque::ChainedJobWithStatus

Inherits:
JobWithStatus show all
Defined in:
lib/resque_ui/overrides/resque_status/chained_job_with_status.rb

Instance Attribute Summary

Attributes inherited from JobWithStatus

#worker

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from JobWithStatus

#counter, #incr_counter, #initialize, #pause!, perform, #safe_perform!, #tick

Constructor Details

This class inherits a constructor from Resque::JobWithStatus

Class Method Details

.enqueue(klass, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
19
20
21
22
# File 'lib/resque_ui/overrides/resque_status/chained_job_with_status.rb', line 15

def self.enqueue(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']
  Resque.enqueue(klass, uuid, options)
  uuid
end

Instance Method Details

#completed(*messages) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/resque_ui/overrides/resque_status/chained_job_with_status.rb', line 7

def completed(*messages)
  super(*messages)
  # "You must override this method to provide your own logic of when to actually call complete."
#      if counter(:processed) >= options['total']
#        super
#      end
end

#nameObject



3
4
5
# File 'lib/resque_ui/overrides/resque_status/chained_job_with_status.rb', line 3

def name
  status.name rescue nil
end