Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: r0.2.0
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (16 sloc) 0.412 kb
$:.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.create_proxy(Worker.new)
10.times do
worker.do_work
end
scheduler.shutdown
Jump to Line
Something went wrong with that request. Please try again.