View on
MetaCPAN
Алексей Пастухов > Gearman > Gearman::Task

Download:
Gearman-2.004.010.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 2.004.010   Source  

NAME ^

Gearman::Task - a task in Gearman, from the point of view of a client

SYNOPSIS ^

    my $task = Gearman::Task->new("add", "1+2", {
            ...
    });

    $taskset->add_task($task);
    $client->do_task($task);
    $client->dispatch_background($task);

DESCRIPTION ^

Gearman::Task is a Gearman::Client's representation of a task to be done.

USAGE ^

Gearman::Task->new($func, $arg, \%options)

Creates a new Gearman::Task object, and returns the object.

$func is the function name to be run. (that you have a worker registered to process)

$arg is an opaque scalar or scalarref representing the argument(s) to pass to the distributed function. If you want to pass multiple arguments, you must encode them somehow into this one. That's up to you and your worker.

%options can contain:

syntax highlighting: