Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.5.0
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (23 sloc) 0.565 kb
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'procrastinate'
# * murder lazies
# * maintain worker count
scheduler = Procrastinate::Scheduler.start
scheduler.spawn_workers(6) {
# Worker body
loop do
puts "Hiho from worker #{Process.pid}."
sleep rand(1.0) * 3
end
}
# Wait around until something important happens
r, w = IO.pipe
trap('QUIT') { w.write '.' }
loop do
IO.select([r], nil, nil)
r.read_nonblock(1000)
# When we reach this point, a QUIT signal has been sent to the process.
# Abort.
break
end
scheduler.shutdown
Jump to Line
Something went wrong with that request. Please try again.