Code Monkey home page Code Monkey logo

node-beanstalkd-client's People

Contributors

dependabot[bot] avatar frozon avatar mickhansen avatar ruffrey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ruffrey

node-beanstalkd-client's Issues

Add more documentation

I'm really missing some documentation and/or examples of how to use this client.
In particular, I have no idea how to implement a complete and resilient job lifecycle as described in the beanstalkd protocol. How do I catch and handle DEADLINE_SOON messages from the server? How will I know if the server timed out a reserved job?

Any examples would be much appreciated :)

No read queue item

/src/worker/node_modules/burstable/node_modules/beanstalkd/lib/read-queue.js:40
throw new Error('No read queue item for item, length: ' + data.length);
^

Error: No read queue item for item, length: 65511
at ReadQueue.read (/src/worker/node_modules/burstable/node_modules/beanstalkd/lib/read-queue.js:40:17)
at ReadQueue.read (/src/worker/node_modules/burstable/node_modules/beanstalkd/lib/read-queue.js:49:16)
at ReadQueue.read (/src/worker/node_modules/burstable/node_modules/beanstalkd/lib/read-queue.js:49:16)
at Socket. (/src/worker/node_modules/burstable/node_modules/beanstalkd/lib/read-queue.js:22:13)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)
at TCP.onread (net.js:523:20)

Watch after Reserve not working

In the below code, first reserve command is run and then watch command after 2 secs, but watch command callback is never run.

Is watch not allowed after reserve, so is the reserve is hanging blocking the connection and no further command is run? Is this the way beanstalkd works or is this this client library ...

const Beanstalkd = require('beanstalkd').default;

let client = new Beanstalkd('127.0.0.1', 11300);
client.connect().then(function (client) {
    console.log('going to reserve');
    client.reserve()
        .then(function (err, jobid, payload) {
            if (err) { console.log(err) }
            console.log(`Job Id ${jobid}`);
            console.log(`Job data ${payload.toString()}`);
            client.destroy(jobid, function (err) {
                if (err) { console.log(err) }
                console.log(`Job deleted ${jobid}`);
            });
        });
})

setTimeout(() => {
    console.log('going to watch')
    client.watch('low-volume')
        .then((tubecount) => {
            console.log(tubecount);
        })
        .catch(err => {
            console.log(err);
        })
}, 2000)

setTimeout(function () {
    console.log("Hello");
}, 3000);

Output

going to reserve
going to watch
Hello

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.