chilts / mongodb-queue

Message queues which uses MongoDB.
209 stars 92 forks source link

Allow many messages to be added in bulk #16

Closed david-martin closed 7 years ago

david-martin commented 7 years ago

Hi @chilts, This change allows an array of messages to be added with 1 call to Queue.add(). The callback signature changes in this scenario and gives an array of id's for the added messages. The underlying logic makes use of collection.insertMany, sending all messages to mongodb in 1 call.

What are your thoughts on adding this change?

chilts commented 7 years ago

Hi @david-martin - wow, that's so cool. Yes, I'd love to have this feature.

I will take a look over it tonight and will try and figure out why Travis is failing. After that, I'll merge and release a new version as soon as I can. :)

david-martin commented 7 years ago

Thanks @chilts. Each of the tests passed for me individually, but the ping test failed when all tests ran together. I shall also look into this when I get a chance

chilts commented 7 years ago

Yeah, the tests passed for me locally too. Merging and releasing.

chilts commented 7 years ago

Released as v2.2.0.