Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.
/ pg-bus Public archive

Simple multiplexed PubSub on top of PostgreSQL LISTEN/NOTIFY.

Notifications You must be signed in to change notification settings

kolesnikovde/pg-bus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg-bus

Simple multiplexed PubSub on top of PostgreSQL LISTEN/NOTIFY.

Installation

$ npm i pg-bus

Usage

var pg  = require('pg');
var bus = require('pg-bus');

var url = 'postgres://localhost/postgres';

pg.connect(url, function(err, db) {
  if (err) throw err;

  var messages = bus(db, 'messages');

  messages.listen('message', function(data) {
    console.log(data);
    // { foo: 'bar' }
  });

  messages.notify('message', { foo: 'bar' });
});

License

MIT

About

Simple multiplexed PubSub on top of PostgreSQL LISTEN/NOTIFY.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published