Gearman-JobScheduler

 view release on metacpan or  search on metacpan

samples/AdditionAlwaysFails.pm  view on Meta::CPAN

package AdditionAlwaysFails;

use strict;
use warnings;
use Modern::Perl "2012";

use Moose;
with 'Gearman::JobScheduler::AbstractFunction';


# Run job
sub run($;$)
{
	my ($self, $args) = @_;

	my $a = $args->{a};
	my $b = $args->{b};

	say STDERR "Going to add $a and $b";

	die "Algebra is hard.";
}


no Moose;    # gets rid of scaffolding


# Return package name instead of 1 or otherwise worker.pl won't know the name of the package it's loading
__PACKAGE__;



( run in 0.777 second using v1.01-cache-2.11-cpan-fe3c2283af0 )