Permalink
Browse files

Tasks for the async-observer plugin's worker

  • Loading branch information...
1 parent e6e055b commit cc7b47a0ec8dff90da741c2256b42c19778988a9 @topfunky topfunky committed Nov 3, 2008
Showing with 25 additions and 0 deletions.
  1. +6 −0 README.txt
  2. +15 −0 recipes/peepserver_runit.rb
  3. +4 −0 recipes/templates/runit/async_observer_worker.erb
View
@@ -11,3 +11,9 @@ Some are highly customized for my current server (nginx, runit, thin, ruby-enter
Use at your own risk.
+== USAGE
+
+If you use the async-observer plugin and use this plugin to register a runit service for it, you'll also need to register the restart task in your own Capistrano deployment recipe file.
+
+ after "deploy:restart", "peepcode:runit:restart_async_observer"
+
@@ -45,6 +45,21 @@ def install_runit_service(service_name)
install_runit_service("beanstalkd")
end
+ desc "Install beanstalk worker for async-observer plugin"
+ task :async_observer do
+ async_observer_service_path = File.join(shared_runit_service_path, "#{application}-async_observer")
+ run "mkdir -p #{async_observer_service_path}"
+
+ result = render_erb_template(File.dirname(__FILE__) + "/templates/async_observer_worker.erb")
+ put result, "#{async_observer_service_path}/run", :mode => 0755
+ run "ln -s #{async_observer_service_path} ~/service/"
+ end
+
+ desc "Restart async-observer worker for this application"
+ task :restart_async_observer do
+ run "sv restart ~/service/#{application}-async_observer"
+ end
+
desc "Install runit task for memcache"
task :memcached do
install_runit_service("memcached")
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec 2>&1
+exec /opt/ruby-enterprise/bin/ruby <%= current_path %>/vendor/plugins/async_observer/bin/worker

0 comments on commit cc7b47a

Please sign in to comment.