diff options
Diffstat (limited to 'lib/POE')
-rw-r--r-- | lib/POE/Component/Pg.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/POE/Component/Pg.pm b/lib/POE/Component/Pg.pm index e61935b..8217eeb 100644 --- a/lib/POE/Component/Pg.pm +++ b/lib/POE/Component/Pg.pm @@ -247,8 +247,14 @@ sub process_queue { sub dbi_canread { + # check for any notifications + while(my $not = $_[HEAP]{dbi}->pg_notifies) { + $_[KERNEL]->post($_->[0], $_->[2], @$not) + for (grep $_->[1] eq $not->[0], @{$_[HEAP]{listen}}); + } + # check for query results - if($_[HEAP]{state} == 2 && $_[HEAP]{dbi}->pg_ready) { + if($_[HEAP]{state} == 2 && $_[HEAP]{dbi}->pg_ready()) { my $item = shift @{$_[HEAP]{queue}}; # fetch results @@ -270,12 +276,6 @@ sub dbi_canread { # execute next query in the queue, if any $_[KERNEL]->call($_[SESSION], 'process_queue'); } - - # check for any notifications - while(my $not = $_[HEAP]{dbi}->pg_notifies) { - $_[KERNEL]->post($_->[0], $_->[2], @$not) - for (grep $_->[1] eq $not->[0], @{$_[HEAP]{listen}}); - } } |