Sha256: 45bdd913d6699aff1d33be58ca0068590576f20b14022e9082e3f0db93fa2da1

Contents?: true

Size: 667 Bytes

Versions: 2

Compression:

Stored size: 667 Bytes

Contents

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 << Thread.new() { Insque.slow_listen }
    threads << Thread.new() { Insque.slow_janitor }
    threads.each {|t| t.join }
  end

  desc 'Starts insque listener'
  task :listener => :environment do
    trap('TERM') { puts "SIGTERM"; exit 0 }
    Insque.listen
  end

  desc 'Starts insque janitor'
  task :janitor => :environment do
    trap('TERM') { puts "SIGTERM"; exit 0 }
    Insque.janitor
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
insque-0.5.2 lib/tasks/insque.rake
insque-0.5.1 lib/tasks/insque.rake