Module: Resque

Extended by:
Integration::Hooks
Includes:
Integration::Hooks
Defined in:
lib/resque/integration/ordered.rb,
lib/resque/integration.rb,
lib/resque/integration/hooks.rb,
lib/resque/integration/unique.rb,
lib/resque/integration/version.rb,
lib/resque/integration/priority.rb,
lib/resque/integration/backtrace.rb,
lib/resque/integration/continuous.rb,
lib/resque/integration/extensions.rb,
lib/resque/integration/queues_info.rb,
lib/resque/integration/logs_rotator.rb,
lib/resque/integration/configuration.rb,
lib/resque/integration/extensions/job.rb,
app/controllers/resque/jobs_controller.rb,
lib/resque/integration/queues_info/age.rb,
lib/resque/integration/failure_backends.rb,
lib/resque/integration/queues_info/size.rb,
lib/resque/integration/extensions/worker.rb,
lib/resque/integration/queues_info/config.rb,
app/controllers/resque/queues/info_controller.rb,
app/controllers/resque/queues/status_controller.rb,
lib/resque/integration/failure_backends/queues_totals.rb,
lib/resque/integration/monkey_patch/verbose_formatter.rb

Overview

Ordered Job

Ensures that only one job for a given queue will be running on any worker at a given time

Examples:

class TestJob
  include Resque::Integration

  unique { |company_id, param1| [company_id] }
  ordered max_iterations: 10

  def self.execute(meta, company_id, param1)
    heavy_lifting_work
  end
end

class UniqueTestJob
  include Resque::Integration

  unique { |company_id, param1| [company_id] }
  ordered max_iterations: 10, unique: ->(_company_id, param1) { [param1] }
  ...
end

Defined Under Namespace

Modules: Integration, Queues Classes: JobsController, VerboseFormatter

Instance Method Summary collapse

Methods included from Integration::Hooks

after_fork, after_fork=, before_first_fork, before_first_fork=, before_fork, before_fork=

Instance Method Details

#queues_infoObject



28
29
30
31
32
33
34
# File 'lib/resque/integration.rb', line 28

def queues_info
  return @queues_info if defined?(@queues_info)

  queues_info_config = Rails.root.join('config', 'resque_queues.yml')

  @queues_info = Resque::Integration::QueuesInfo.new(config: queues_info_config)
end