Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/revmischa/anymq-pg

Use PostgreSQL as a message queueing backend
https://github.com/revmischa/anymq-pg

Last synced: 3 days ago
JSON representation

Use PostgreSQL as a message queueing backend

Awesome Lists containing this project

README

        

NAME
AnyMQ::Pg - Use built-in PostgreSQL 'LISTEN' and 'NOTIFY' commands for
message-passing.

ABOUT
Enables the use of PostgreSQL as a backend for message queueing
functionality with AnyMQ.

Many people are probably unaware that PostgreSQL has a built-in
asynchronous publish/subscribe mechanism, but it does.

SYNOPSIS
my $bus = AnyMQ->new_with_traits(
traits => ['Pg'],
dsn => 'dbname=postgres user=postgres',
on_connect => sub { ... },
on_error => sub { ... },
);

# see AnyMQ docs for usage
my $topic = $bus->topic('my_event');
my $listen_watcher = $bus->new_listener($topic);
$listen_watcher->poll(sub {
my ($evt) = @_;
warn "Got notified of my_event: " . Dumper($evt);
});
$topic->publish({ foo => 123 });
AE::cv->recv;

SEE ALSO
AnyEvent::Pg, Web::Hippie, Web::Hippie::PubSub

AUTHOR
Mischa Spiegelmock, ""

LICENSE AND COPYRIGHT
Copyright 2012 Mischa Spiegelmock.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.