Tim Bunce wrote:
Since it's very postgres specific I'd suggest it's added to DBD::Pg
as a set of new driver-specific methods:
$dbh = DBI->connect($data_source, $username, $auth, \%attr);
$dbh->pg_register_listener("foo",\&foo); # on "foo" notification call foo sub
$dbh->pg_register_listener("bar",\&foo); # on "bar" notification call foo sub
$dbh->pg_register_listener("bar", undef); # unregister callback for "bar"
$dbh->pg_register_listener("baz", sub { print "baz\n" } );
$dbh->pg_listen(); # loops forever waiting for events
Ideally pg_listen should integrate with existing perl event loops
so it can be used in Tk, POE etc.
Tim.
I see what you mean. I will look to integrate the functionality in DBD::pg.
Best regards
luben