Gearman::Driver::Worker::Base - Base class for workers without method attributes


Gearman-Driver documentation Contained in the Gearman-Driver distribution.

Index


Code Index:

NAME

Top

Gearman::Driver::Worker::Base - Base class for workers without method attributes

DESCRIPTION

Top

If you don't like method attributes you can use this base class instead of Gearman::Driver::Worker and use add_job in Gearman::Driver.

AUTHOR

Top

See Gearman::Driver.

COPYRIGHT AND LICENSE

Top

SEE ALSO

Top

* Gearman::Driver
* Gearman::Driver::Adaptor
* Gearman::Driver::Console
* Gearman::Driver::Console::Basic
* Gearman::Driver::Console::Client
* Gearman::Driver::Job
* Gearman::Driver::Job::Method
* Gearman::Driver::Loader
* Gearman::Driver::Observer
* Gearman::Driver::Worker
* Gearman::Driver::Worker::AttributeParser

Gearman-Driver documentation Contained in the Gearman-Driver distribution.
package Gearman::Driver::Worker::Base;

use Moose;

has 'server' => (
    is  => 'ro',
    isa => 'Str',
);

sub prefix {
    return ref(shift) . '::';
}

sub begin { }

sub end { }

sub process_name {
    return 0;
}

sub override_attributes {
    return {};
}

sub default_attributes {
    return {};
}

sub decode {
    my ( $self, $result ) = @_;
    return $result;
}

sub encode {
    my ( $self, $result ) = @_;
    return $result;
}

no Moose;

__PACKAGE__->meta->make_immutable;

1;