forked from benlund/node-beanstalk-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
42 lines (25 loc) · 876 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Beanstalk Worker for Node.js
============================
version 0.2.0
Simple BeanstalkWorker and BeanstalkWorkerCluster objects for connecting to a beanstalkd queue and running jobs.
requires node-beanstalk-worker
Try it:
In one console:
$ node test/produce_test_jobs.js
In another:
$ node bin/worker.js
===
NPM:
$ npm install beanstalk_worker
-> Creates nbworker as an executable symlink to bin/worker.js (Will also install the client lib)
You can pass this script the path to a config file to specify how many client connections to open, where the handlers for jobs are, and so forth:
$ nbworker conf/example.js
$ cat conf/example.js
module.exports = {
workers: 3,
server: '127.0.0.1:11300',
tubes: ['external'],
ignore_default: true,
handlers: ['../handlers/test', '../handlers/http_request']
};
console.log('Loaded conf/example.js config');