module Ruote::Resque
Ruote::Resque
allows a Ruote
engine to delegates the work of it’s participants to Resque
workers.
Common use cases include:
-
You run a lot of jobs and need the reliability of
Resque
to process your jobs -
You have a
Resque
system you need to integrate with -
You want a separation of concerns between process orchestration and actual execution
See the {file:README} for usage instructions
Constants
- VERSION
Attributes
Returns the current {Configuration}
Public Class Methods
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
@return [Logger] the logger to be used inside ruote-resque
# File lib/ruote/resque/client.rb, line 41 def logger configuration.logger end
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
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