---
name: "Gearman::Taskset"
section: "3pm"
platform: "linux"
package: "libgearman-client-perl"
version: "2.004.015-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Gearman::Taskset"
---

# Gearman::Taskset(3pm)

a taskset in Gearman, from the point of view of a Gearman::Client

## NAME

Gearman::Taskset - a taskset in Gearman, from the point of view of a Gearman::Client

## SYNOPSIS

```
    use Gearman::Client;
    my $client = Gearman::Client->new;
    # waiting on a set of tasks in parallel
    my $ts = $client->new_task_set;
    $ts->add_task( "add" => "1+2", {...});
    $ts->wait();
```

## DESCRIPTION

Gearman::Taskset is a Gearman::Client's representation of tasks queue

## METHODS

### new($client)

### wait(%opts)

Waits for a response from the job server for any of the tasks listed in the taskset. Will call the *on\_\** handlers for each of the tasks that have been completed, updated, etc.  Doesn't return until everything has finished running or failing.

### add\_task(Gearman::Task)

### add\_task($func, \<$scalar \| $scalarref\>, \<$uniq \| $opts\_hr\>

Adds a task to the taskset.  Three different calling conventions are available.

`$opts_hr` see Gearman::Task
