---
name: "Gearman::Objects"
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::Objects"
---

# Gearman::Objects(3pm)

a parent class for Gearman::Client and Gearman::Worker

## NAME

Gearman::Objects - a parent class for Gearman::Client and Gearman::Worker

## METHODS

### job\_servers(\[$job\_servers\])

Initialize the list of job servers. `$job_servers`should be array or array reference of hash references or stringified job servers. If the port number is not provided, `4730` is used as the default. For example:

```
    C<< $client->job_servers('127.0.0.1', { host => "192.168.1.100", port => 4730 }); >>
```

**return** `"[job_servers]"`

### set\_job\_servers($js)

set job\_servers attribute by canonicalized `$js`

### canonicalize\_job\_servers($js)

`$js` a string, hash reference or array reference of aforementioned.

Hash reference should contain at least host key.

All keys: host, port (4730 on default), use\_ssl, ca\_file, cert\_file, key\_file, socket\_cb

**return** \[canonicalized list\]

### func($func)

**return** `"join $prefix_separator, $prefix, $func"`

### prefix(\[$prefix\])

get/set the namespace / prefix for the function names.

### prefix\_separator(\[$separator\])

getter/setter

default: "\\t"

*If gearmand uses memcached persistent queue type, override default separator to insure jobs recovery*

### socket($js, \[$timeout\])

depends on `"use_ssl"` prepare IO::Socket::IP or IO::Socket::SSL

- •

  `$host_port` peer address

- •

  `$timeout` default: 1

**return** depends on `"use_ssl"` IO::Socket::(IP\|SSL) on success

### sock\_nodelay($sock)

set TCP\_NODELAY on `$sock`, die on failure
