AnyMQ::Pg - Use built-in PostgreSQL 'LISTEN' and 'NOTIFY' commands for message-passing.
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.
http://www.postgresql.org/docs/9.1/interactive/sql-listen.html
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;
AnyEvent::Pg, Web::Hippie, Web::Hippie::PubSub
Mischa Spiegelmock, <revmischa at cpan.org>
<revmischa at cpan.org>
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.
To install AnyMQ::Pg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyMQ::Pg
CPAN shell
perl -MCPAN -e shell install AnyMQ::Pg
For more information on module installation, please visit the detailed CPAN module installation guide.