Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/revmischa/anymq-pg
- Owner: revmischa
- Created: 2012-05-06T00:56:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-11-04T23:05:50.000Z (about 12 years ago)
- Last Synced: 2024-10-18T07:52:34.740Z (3 months ago)
- Language: Perl
- Size: 160 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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::PubSubAUTHOR
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.