| 1 | package Hopkins::Task; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Hopkins::Task - task object | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | Hopkins::Task represents a configured task that is available | ||
| 12 | for enqueuing. it typically has a schedule associated with | ||
| 13 | it. | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | use base 'Class::Accessor::Fast'; | ||
| 18 | |||
| 19 | use Hopkins::TaskOption; | ||
| 20 | |||
| 21 | __PACKAGE__->mk_accessors(qw(name class cmd queue stack schedule options chain run enabled onerror)); | ||
| 22 | |||
| 23 | sub params | ||
| 24 | { | ||
| 25 | my $self = shift; | ||
| 26 | |||
| 27 | return { map { $_->value ? ($_->name => $_->value) : () } @{ $self->options } }; | ||
| 28 | } | ||
| 29 | |||
| 30 | =back | ||
| 31 | |||
| 32 | =head1 AUTHOR | ||
| 33 | |||
| 34 | Mike Eldridge <diz@cpan.org> | ||
| 35 | |||
| 36 | =head1 LICENSE | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | 1; | ||
| 41 |