我正在尝试编写一个轮询db表并使用Poe wheel run处理找到的记录的应用程序。这似乎并不完美。有任何建议。
db poll sql
SELECT request_type destination port request FROM table1
WHERE STATUS_ID=200 limit 10;
结果打印到屏幕并通过poe wheel run
获取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",
);
db poll产生的结果比轮子可以处理的速度快。
有任何设计建议吗?