Reviewable / firelease

Firebase queue consumer for Node with at-least-once semantics.
MIT License
10 stars 1 forks source link

Options Don't Work #3

Closed calendee closed 9 years ago

calendee commented 9 years ago

Can you explain how to use options that are passed to attachWorker?

I'm doing this :

var options = { maxConcurrent: 2, bufferSize: 5, minLease: '5s', maxLease: '15s' };

Firelease.attachWorker(db.child('queue'), options, function(snap) {....});

or 

var options = { maxConcurrent: 2, bufferSize: 5, minLease: 5000, maxLease: 15000 };

Firelease.attachWorker(db.child('queue'), options, function(snap) {....});

However, in function Queue they all end up getting converted to :

{ maxConcurrent: 2, bufferSize: 2, minLease: 2, maxLease: 2 }

This results in multiple attempts to process the same queue item.

However, if I just use the defaults , everything works fine.

calendee commented 9 years ago

Never mind. I was the problem. I wasn't passing in options the way I described.