Giter Site home page Giter Site logo

node-mongo-queue's People

Contributors

deployable avatar hannesgassert avatar kof avatar marsup avatar werehamster 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-mongo-queue's Issues

Incompatibility with newer mongodb versions: catch findandmodify error

When polling for new tasks it often happens that there's no matches for the find() part of findandmodify()

Older versions of the driver just returned null, newer return a MongoError with errmsg='No matching object found'. In order to make mojo work with recent versions of the driver we have to handle that case in the callback passed to Connection.next() inside Worker.poll. In JS:

if (err != null && err.errmsg !== 'No matching object found') {
          this.emit('error', err);
}

Thanks! :)

Any performance feedbacks ?

Hello Tomas !

I've discovered mojo recently and I must say I've been quite impressed with the work you have done !

I was on my way to test it a bit and I was wondering if you (or anyone reading this) had some figures or real world uses of it that could give me hints on what kind of performance to expect from such solution.
Do you think it could handle a massive amount of jobs (~10k) in a decent time (< 5 mins) ? Across a cluster of mongodbs ?

Regards.

Release 1.0.0

Hi @kof,

I've pushed updates to make this module work with the new mongodb 2.0 module.
Since I don't have the publish rights can you do it ?
Also can you see if it's possible to enable travis ? I've already added the configuration file, it should be straightforward.

Thanks.

API change to allow more granularity

Hi,

I'd like to engage in a breaking change in the library but before doing that I thought it would be clever to discuss that.

I think the template should be responsible for its parameters, which would allow to override per job, by that I mean an API like that :

class Addition extends queue.Template
  # Default values for that template
  @expires = 5000 
  @maxAttempts = 20

  perform: (a, b) ->
    console.log a + ' + ' + b + ' = ' + (a + b)
    @complete()

addition = new Addition(1, 1)
addition.expires = 10000
addition.maxAttempts = 10

connection.enqueue addition

What do you think ?

Add support for MongoDb authentication

For folks (like me) trying out mojo on some hosted environment / PaaS being able to use an authenticated connection to Mongo would be very helpful.

Without knowing any CoffeeScript I tried this, which even sort of helped:

 new mongodb.Db(opt.db, server, {}).open (err, db) =>
      db.authenticate opt.username, opt.password, (err)  => 
        db.collection 'mojo', (err, collection) =>
          @mojo = collection
          ...

Start date

Hi,

I need to set up tasks for a later time, I think the current code can't handle non-immediate tasks, would you accept a PR for that ?
That might depend (and be easier with) #9.

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.