lib/tasks/insque.rake in insque-0.3.1 vs lib/tasks/insque.rake in insque-0.3.2
- old
+ new
@@ -1,5 +1,14 @@
namespace :insque do
+ desc 'Starts insque listener and janitor'
+ task :run => :environment do
+ trap('TERM') { puts "SIGTERM"; exit 0 }
+ threads = {}
+ threads << Thread.new() { Insque.listen }
+ threads << Thread.new() { Insque.janitor }
+ threads.each {|t| t.join }
+ end
+
desc 'Starts insque listener'
task :listener => :environment do
trap('TERM') { puts "SIGTERM"; exit 0 }
Insque.listen
end