Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (16 sloc) 405 Bytes
$:.unshift File.dirname(__FILE__) + '/../lib'
require 'procrastinate'
include Procrastinate
class Worker
def do_work
puts "> Starting work in process #{Process.pid}"
sleep 2
puts "< Work completed in process #{Process.pid}"
end
end
scheduler = Scheduler.start(SpawnStrategy::Throttled.new(5))
worker = scheduler.proxy(Worker.new)
10.times do
worker.do_work
end
scheduler.shutdown
Jump to Line
Something went wrong with that request. Please try again.