From 01c606e40ee414d82f82c5b43bef62c7395d7e68 Mon Sep 17 00:00:00 2001 From: Loren Sands-Ramshaw Date: Sun, 1 May 2011 14:50:15 -0400 Subject: [PATCH] added multiple worker example --- README.textile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.textile b/README.textile index e56ef3edf..42419cf2c 100644 --- a/README.textile +++ b/README.textile @@ -99,7 +99,16 @@ You can also run by writing a simple @script/job_runner@, and invoking it extern 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: + +

+  3.times do |n|
+    worker = Delayed::Worker.new
+    worker.name = 'worker-' + n.to_s
+    worker.start
+  end	
+
+ 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.