Skip to content

Commit

Permalink
Merge pull request #43 from lorensr/master
Browse files Browse the repository at this point in the history
Added multiple worker example to README
  • Loading branch information
Tobias Lütke committed Aug 11, 2011
2 parents e7661d3 + 01c606e commit d9165b9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ You can also run by writing a simple @script/job_runner@, and invoking it extern
</code></pre>

Workers can be running on any computer, as long as they have access to the database and their clock is in sync. You can even
run multiple workers on per computer, but you must give each one a unique name. (TODO: put in an example)
run multiple workers on per computer, but you must give each one a unique name:

<pre><code>
3.times do |n|
worker = Delayed::Worker.new
worker.name = 'worker-' + n.to_s
worker.start
end
</code></pre>

Keep in mind that each worker will check the database at least every 5 seconds.

Note: The rake task will exit if the database has any network connectivity problems.
Expand Down

0 comments on commit d9165b9

Please sign in to comment.