in reply to Re: Replacing Parallel::ForkManger With Thread::Queue
in thread Replacing Parallel::ForkManger With Thread::Queue
$pm->run_on_finish(sub { my ($pid, $exit_code, $ident) = @_; eval { my $filename = '/tmp/' . $$ . escape($ident); my $result_set; if (-e $filename) { $result_set = $obj->retrieve($filename); unlink($filename); }else { # need a new $timeout_result object every loop my $timeout_result = new DBWIZ::Search::ResultSet; $timeout_result->status('timeout'); $timeout_result->hits(-5); $result_set = $timeout_result; } $return{$ident} = $result_set; }; if ($@) { print STDERR "Problem with search module: $@\n"; } # print STDERR "database $ident done = exit $exit_code \n"; });
my $obj = Data::Serializer->new( serializer => 'Storable', portable => '1', encoding => 'b64', );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Replacing Parallel::ForkManger With Thread::Queue
by ysth (Canon) on May 26, 2009 at 08:20 UTC | |
by shanu_040 (Sexton) on May 26, 2009 at 11:14 UTC | |
by Zen (Deacon) on May 26, 2009 at 13:14 UTC |