forked from benlund/node-beanstalk-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
39 lines (25 loc) · 815 Bytes
/
README
File metadata and controls
39 lines (25 loc) · 815 Bytes
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
Beanstalkd Client for Node.js
=============================
Version: 0.2.0
Example:
var client = require('beanstalk_client').Client;
client.connect('127.0.0.1:11300', function(err, conn) {
var job_data = {"data": {"name": "node-beanstalk-client"}};
conn.put(0, 0, 1, JSON.stringify(job_data), function(err, job_id) {
console.log('put job: ' + job_id);
conn.reserve(function(err, job_id, job_json) {
console.log('got job: ' + job_id);
console.log('got job data: ' + job_json);
console.log('module name is ' + JSON.parse(job_json).data.name);
conn.destroy(job_id, function(err) {
console.log('destroyed job');
});
});
});
});
Try it:
$ node test/test.js
See also: http://github.com/benlund/node-beanstalk-worker
===
NPM:
$ npm install beanstalk_client