Description
perl-AnyMQ-Pg - Use built-in PostgreSQL 'LISTEN' and 'NOTIFY' commands for message-passing
Distribution: ALT Linux Sisyphus
Repository: Autoimports noarch
Package name: perl-AnyMQ-Pg
Package version: 0.01
Package release: alt1
Package architecture: noarch
Package type: rpm
Installed size: 8.50 KB
Download size: 8.50 KB
Official Mirror: ftp.altlinux.org
my $bus = AnyMQ->new_with_traits(
traits => ['Pg'],
dsn => 'dbname=postgres user=postgres',
on_connect => sub { ... },
on_error => sub { ... },
);
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;