Giter Site home page Giter Site logo

disqueue-node's People

Stargazers

 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

disqueue-node's Issues

parse job

How to parse body of the job (getJob API),now,it is ‘[object,object]’

getJob Unhanded error when data is undefined

When there are no jobs in the queue, data in getJob is undefined:

/Users/larlyn/projects/newlangs/disque/node_modules/disqueue-node/lib/commands-list/get-job.js:50
            for ( var i = 0; i < data.length; ++i ) {
                                     ^

TypeError: Cannot read property 'length' of null
    at null.callback (/Users/larlyn/projects/newlangs/disque/node_modules/disqueue-node/lib/commands-list/get-job.js:50:29)
    at DisqueClient.sendReply (/Users/larlyn/projects/newlangs/disque/node_modules/disqueue-node/lib/disqueue-client.js:210:17)
    at self.parser.execute (/Users/larlyn/projects/newlangs/disque/node_modules/disqueue-node/lib/disqueue-client.js:187:10)
    at Socket.<anonymous> (/Users/larlyn/projects/newlangs/disque/node_modules/disqueue-node/lib/disqueue-client.js:77:15)
    at emitOne (events.js:82:20)
    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)

disque is version disque 1.0-rc1

Show job returns response as an an array, not an object with keys and values

When I call disqueue.show(), the result is a 'raw' array where each odd-indexed element is a key, and each even-indexed element is the value. (I am not sure if the other commands return data in a similar format). It would be useful if disqueue-node automatically turned the raw, array response into an object hash that could be used easily

Current response:

result = [
 'id'
 'D-0ca28763-t8Tl5YL/P5+9vaJ6utmv7/e8-05a1',
 'queue',
 'my-disqueue',
 'state',
 'queued',
 ...
]

What I think it should be:

result: {
 id: ''D-0ca28763-t8Tl5YL/P5+9vaJ6utmv7/e8-05a1',
 queue: 'my-disqueue',
 state: 'queued',
 ...
}

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.