Changeset 8016 for lang/perl/App-MadEye

Show
Ignore:
Timestamp:
03/17/08 11:57:59 (8 months ago)
Author:
tokuhirom
Message:

- Worker::Simple: added schema
- Worker::Simple: added docs.
- Worker::Simple: timeout is now configurable.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/App-MadEye/trunk/lib/App/MadEye/Plugin/Worker/Simple.pm

    r7560 r8016  
    22use strict; 
    33use warnings; 
    4 use base qw/Class::Component::Plugin/; 
     4use base qw/App::MadEye::Plugin::Base/; 
    55use App::MadEye::Util; 
    66use Params::Validate; 
    7  
    8 our $TIMEOUT = 60;  # TODO: configurable 
    97 
    108sub run_job :Method { 
     
    1311    $context->log( debug => "watching $args->{target} by $args->{plugin}" ); 
    1412 
    15     timeout $TIMEOUT, "watching $args->{target} $args->{plugin}", sub { 
     13    my $timeout = $self->config->{config}->{task_timeout} or die "missing task_timeout"; 
     14    timeout $timeout, "watching $args->{target} $args->{plugin}", sub { 
    1615        if ( my $message = $args->{plugin}->is_dead( $args->{target} ) ) { 
    1716            $context->add_result( 
     
    2726 
    28271; 
     28__END__ 
    2929 
     30=head1 NAME 
     31 
     32App::MadEye::Plugin::Worker::Simple - simple worker 
     33 
     34=head1 SCHEMA 
     35 
     36    type: map 
     37    mapping: 
     38        task_timeout: 
     39            required: yes 
     40            type: int 
     41 
     42=head1 SEE ALSO 
     43 
     44L<App::MadEye>