Module: Blue::Resque

Defined in:
lib/blue/resque.rb,
lib/blue/resque/version.rb,
lib/blue/resque/capistrano/integration.rb

Defined Under Namespace

Modules: Capistrano

Constant Summary collapse

VERSION =
"0.0.16"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configureObject



9
10
11
12
13
14
15
# File 'lib/blue/resque.rb', line 9

def self.configure
  Blue.configure({
    :resque => {
      :queues => {}
    }
  })
end

.included(klass) ⇒ Object



35
36
37
38
39
40
# File 'lib/blue/resque.rb', line 35

def self.included(klass)
  klass.add_role(:resque)
  klass.class_eval do
    recipe :resque_monitoring
  end
end

.worker_pid_path(worker_id) ⇒ Object



17
18
19
# File 'lib/blue/resque.rb', line 17

def self.worker_pid_path(worker_id)
  File.join(Blue.shared_path, 'pids', "/resque_worker_#{worker_id}.pid")
end

Instance Method Details

#resque_monitoringObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/blue/resque.rb', line 21

def resque_monitoring
  if Blue.const_defined?(:Monit)
    file "/etc/monit/conf.d/resque.conf",
      :ensure  => :present,
      :mode    => '700',
      :backup  => false,
      :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'monit.conf.erb'), binding),
      :notify  => service('monit')

  elsif Blue.const_defined?(:God)
    # Define this yo'self homie.
  end
end