Pake::MultiTask - Pake::MultiTask documentation


pake documentation Contained in the pake distribution.

Index


Code Index:

NAME

Top

    Pake::MultiTask

SYNOPSIS

Top

    use Pake::MultiTask;
    $multi_task = Pake::MultiTask->new($code,$name,$dependency_array_ref);
    $mulit_task->invoke();




Description

Top

MultiTask task, executes dependencies in parallel. Right now there is no guarantee that dependencies want be run more then once

Methods

Overview of overriden methods in the FileTask object

invoke_prerequisites

Parrallel invocation

inoker

Thread method invoke


pake documentation Contained in the pake distribution.

package Pake::MultiTask;

@ISA = qw(Pake::Task);

use threads;
use Scalar::Util qw(blessed);

sub invoke_prerequisites {
    my $self = shift;
    my @threads = ();
    for $pre (@{$self->{"pre"}}){
        if(blessed ($self->{"application"}{"tasks"}{$pre})){
	    my $thread = threads->new(\&invoker,$self->{"application"}{"tasks"}{$pre});
	    push @threads, $thread;
        } else{
	    warn "cannot apply rules" unless $self->{"application"}->check_rules($pre);
        }
    }

    for my $thread (@threads){
	$thread->join();
    }
}

sub invoker($){
    my $task = shift;
    $task->invoke();
}

1;


__END__