Permalink
Browse files

more docs

  • Loading branch information...
1 parent 83ee1f8 commit 9cead070529177528f442598f89fc18e470451ad @seanhess seanhess committed Aug 30, 2012
Showing with 16 additions and 1 deletion.
  1. +16 −1 README.md
View
@@ -50,7 +50,22 @@ Handle a job (jobs are balanced between workers)
messagehub = require 'messagehub'
myhub = messagehub 'localhost', 'mychannel'
myhub.worker 'jobs.one', (data, done) ->
- console.log "MESSAGES.ONE", data
+ console.log "JOBS.ONE", data
+ done()
+
+You can put more than one worker in the same file. It will only send you one job per worker registered.
+
+ messagehub = require 'messagehub'
+ myhub = messagehub 'localhost', 'mychannel'
+
+ # handler function
+ handleJobOne = (data, done) ->
+ console.log "JOBS.ONE", data
done()
+ # register 4 workers
+ myhub.worker 'jobs.one', handleJobOne
+ myhub.worker 'jobs.one', handleJobOne
+ myhub.worker 'jobs.one', handleJobOne
+ myhub.worker 'jobs.one', handleJobOne

0 comments on commit 9cead07

Please sign in to comment.