Sha256: ae13668dddbd710335190acb4ed241c2e6376a9f24a488d4967f26d8b300f7a8

Contents?: true

Size: 699 Bytes

Versions: 14

Compression:

Stored size: 699 Bytes

Contents

module Resque
  class ChainedJobWithStatus < JobWithStatus
    def name
      status.name rescue nil
    end

    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

    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
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
resque_ui-3.2.4 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.2.3 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.2.2 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.2.1 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.2.0 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.7 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.6 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.5 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.4 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.3 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.2 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.1 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.1.0 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb
resque_ui-3.0.0 lib/resque_ui/overrides/resque_status/chained_job_with_status.rb