Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

benlund/node-beanstalk-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Node.js client for beanstalkd

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published