App-madeye

 view release on metacpan or  search on metacpan

lib/App/MadEye.pm  view on Meta::CPAN

use Params::Validate;
use UNIVERSAL::require;
use Log::Dispatch;
__PACKAGE__->load_components(qw/Plaggerize Autocall::InjectMethod/);

my $context;
sub context { $context }

sub new {
    my $class = shift;
    my $self = $class->SUPER::new(@_);

    $self->{results} = {};
    $context = $self;

    $self->_setup_logger;

    $self;
}

sub run {

lib/App/MadEye/Plugin/Base.pm  view on Meta::CPAN

package App::MadEye::Plugin::Base;
use strict;
use warnings;
use base qw/Class::Component::Plugin/;
use App::MadEye::Util qw/get_schema_from_pod/;
use Kwalify ();

sub new {
    my $class = shift;
    my $self = $class->SUPER::new(@_);

    if (my $schema = get_schema_from_pod($self)) {
        local $SIG{__DIE__} = sub { die "$self: @_" };
        Kwalify::validate($schema, $self->config->{config});
    }

    $self;
}

1;

lib/App/MadEye/Plugin/Worker/Gearman.pm  view on Meta::CPAN

use Storable qw/freeze thaw/;
use YAML;
use Scalar::Util qw/weaken/;

__PACKAGE__->mk_accessors(qw/task_set child_pids gearman_client/);

our $CHILD_TIMEOUT = 60;  # TODO: configurable

sub new {
    my $class = shift;
    my $self = $class->SUPER::new(@_);

    my $gearman_client = $self->get_gearman_client;
    $self->gearman_client( $gearman_client );
    my $task_set = $gearman_client->new_task_set;
    $self->task_set( $task_set );

    $self;
}

sub before_run_jobs : Hook {



( run in 0.347 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )