Permalink
Browse files

Adds forking task for rake

  • Loading branch information...
1 parent 3c7953e commit b90a9ef1439d953b1d5213453affddf89ea14c69 @nesquena committed Dec 28, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/backburner/tasks.rb
@@ -18,6 +18,15 @@
end
end # simple
+ namespace :forking do
+ # QUEUE=foo,bar,baz rake backburner:forking:work
+ desc "Starts backburner worker using fork processing"
+ task :work => :environment do
+ queues = (ENV["QUEUE"] ? ENV["QUEUE"].split(',') : nil) rescue nil
+ Backburner.work queues, :worker => Backburner::Workers::Forking
+ end
+ end # forking
+
namespace :threads_on_fork do
# QUEUE=twitter:10:5000:5,parse_page,send_mail,verify_bithday THREADS=2 GARBAGE=1000 rake backburner:threads_on_fork:work
# twitter tube will have 10 threads, garbage after 5k executions and retry 5 times.

0 comments on commit b90a9ef

Please sign in to comment.