module Ruote::Resque

Ruote::Resque allows a Ruote engine to delegates the work of it’s participants to Resque workers.

Common use cases include:

See the {file:README} for usage instructions

Constants

VERSION

Attributes

configuration[RW]

Returns the current {Configuration}

Public Class Methods

configure() { |configuration| ... } click to toggle source

This method allows you to customize the ruote-resque configuration. @see Configuration @yield [Configuration] @return [void]

# File lib/ruote/resque/client.rb, line 49
def configure
  self.configuration ||= Ruote::Resque::Configuration.new
  yield(configuration) if block_given?
end
logger() click to toggle source

@return [Logger] the logger to be used inside ruote-resque

# File lib/ruote/resque/client.rb, line 41
def logger
  configuration.logger
end
register(dashboard, &block) click to toggle source

Registers resque participants using a DSL. @example Using the dsl

Ruote::Resque.register dashboard do
  be_awesome MyAwesomeJob, :my_queue
  be_really_awesome 'MyReallyAwesomeJob', :my_queue, :forget => true
end

@example Using the participant method

Ruote::Resque.register dashboard do
  participant /be_.*/, BeSomething, :my_queue
end

@param [Ruote::Dashboard] dashboard the ruote dashboard @return [void]

# File lib/ruote/resque.rb, line 34
def self.register(dashboard, &block)
  registrar = Ruote::Resque::ParticipantRegistrar.new(dashboard)
  registrar.instance_eval(&block)
end
reply(*args) click to toggle source

Enqueues a ReplyJob with the given arguments. @return true if the job was queued, nil if the job was rejected by a before_enqueue hook. @example

Ruote::Resque.reply(workitem)
# File lib/ruote/resque/client.rb, line 36
def reply(*args)
  ::Resque.enqueue(Ruote::Resque::ReplyJob, *args)
end