0.0.3 • Published 8 years ago

so-punctual v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

so-punctual

Usage
const Punctual = require('so-punctual');

Punctual
    .connect({ mongo: { uri: 'mongodb://localhost:27017/punctual' } })
    .then((queue) => {

        // create a job for John Doe to be executed every 5 minutes
        queue.create(5, { name: 'John Doe', { times: 0 });

        // process queue
        queue.work((job, done) => {

            User.updateStats('John Doe')
                .then((count) => {

                    // increment the job's data
                    job.data.times++;

                    // process the job less frequently after 10 times
                    if (job.data.times > 10) {
                        job.minutes = 10;
                    }

                    done();
                })
                .catch(console.log);
        });
    })
    .catch(console.log);
0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago