1

Im trying to write a app that polls a db table and processes the records found using Poe wheel run. This doesn't seems to work perfectly . Any suggestions out there.

The db poll sql

SELECT request_type destination port request FROM table1  
    WHERE STATUS_ID=200 limit 10;

results are printed to screen and picked up by poe wheel run

The poe wheel run

sub on_start {
        my $child = POE::Wheel::Run->new(
         Program => [ 'perl ~/sbin/db_poller.pl' ],
         StdoutEvent  => "got_child_stdout",
         StderrEvent  => "got_child_stderr",
         CloseEvent   => "got_child_close",
    );

The db poll produces results faster than the wheel can process.

Any design suggestions?

Machavity
  • 30,841
  • 27
  • 92
  • 100
user2594853
  • 67
  • 1
  • 9
  • or is it better to put the results from the sql query into a file and then monitor the file with poe wheel? – user2594853 Sep 29 '13 at 12:20
  • 1
    It seems strange to me that you are using perl to call a subprocess that runs perl from another script. Why not use `POE::Component::LaDBI` or similar async, POE-y perl module for talking to your database? That way you can just set an event for when rows come back from the database. – jane arc Nov 04 '13 at 18:18

0 Answers0