Skip to content

RoonLabs/node-pg-tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-pg-tasks

Pub/Sub task queue backed by Postgres

Quickstart

const PgTasks = require('@roonlabs/node-pg-tasks');
const client  = new PgTasks({user: 'postgres', password: 'postgres', database: 'testdb'})

client.subscribe(t => {
    console.log('Received task', t);
    t.ack();
});

(async function() {
    try {
        await client.connect();
        while (true) {
            await new Promise(r => setTimeout(r, 1000));
            await client.publish({ type: 'test', foo: 1 });
        }
    } catch (e) {
        console.log(e);
    }
})()

About

Pub/sub task queue backed by Postgres

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published