---
name: "gearman_worker_timeout"
section: "3"
platform: "linux"
package: "gearmand"
version: "2.2.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gearman_worker_timeout"
---

# gearman\_worker\_timeout(3)

Gearmand Documentation, https://gearman.org/gearmand/

## NAME

gearman\_worker\_timeout - Gearmand Documentation, https://gearman.org/gearmand/

## SYNOPSIS

\#include \<libgearman/gearman.h\>

- **type gearman\_worker\_st**

  - **type gearman\_worker\_set\_task\_context\_free\_fn**

  - **int gearman\_worker\_timeout(*gearman\_worker\_st* \*worker)**

  - **void gearman\_worker\_set\_timeout(*gearman\_worker\_st* \*worker, int timeout)**

  - **void \*gearman\_worker\_context(const *gearman\_worker\_st* \*worker)**

  - **void gearman\_worker\_set\_context(*gearman\_worker\_st* \*worker, void \*context)**

  - **void gearman\_worker\_set\_workload\_malloc\_fn(*gearman\_worker\_st* \*worker, *gearman\_malloc\_fn* \*function, void \*context)**

  - **void gearman\_worker\_set\_workload\_free\_fn(*gearman\_worker\_st* \*worker, *gearman\_free\_fn* \*function, void \*context)**

  - ***gearman\_return\_t* gearman\_worker\_wait(*gearman\_worker\_st* \*worker)**

  - ***gearman\_return\_t* gearman\_worker\_register(*gearman\_worker\_st* \*worker, const char \*function\_name, *uint32\_t* timeout)**

  - ***gearman\_return\_t* gearman\_worker\_unregister(*gearman\_worker\_st* \*worker, const char \*function\_name)**

  - ***gearman\_return\_t* gearman\_worker\_unregister\_all(*gearman\_worker\_st* \*worker)**

  - **void gearman\_job\_free\_all(*gearman\_worker\_st* \*worker)**

  - ***bool* gearman\_worker\_function\_exist(*gearman\_worker\_st* \*worker, const char \*function\_name, *size\_t* function\_length)**

  - ***gearman\_return\_t* gearman\_worker\_work(*gearman\_worker\_st* \*worker)**

  - ***gearman\_job\_st* \*gearman\_worker\_grab\_job(*gearman\_worker\_st* \*worker, *gearman\_job\_st* \*job, *gearman\_return\_t* \*ret\_ptr)**

  Link with -lgearman

## DESCRIPTION

*gearman\_worker\_st* is used for worker communication with the server.

*gearman\_worker\_context()* and *gearman\_worker\_set\_context()* can be used to store an arbitrary object for the user.

*gearman\_worker\_set\_task\_context\_free\_fn()* sets a trigger that will be called when a *gearman\_task\_st* is released.

*gearman\_worker\_timeout()* and *gearman\_worker\_set\_timeout()* get and set the current timeout value, in milliseconds, for the worker.

*gearman\_worker\_function\_exist()* is used to determine if a given worker has a specific function.

*gearman\_worker\_work()* have the worker execute against jobs until an error occurs.

*gearman\_worker\_grab\_job()* Takes a job from one of the job servers. It is the responsibility of the caller to free the job once they are done. This interface is used in testing, and is very rarely the correct interface to program against.

Normally **[malloc(3)](/malloc/3.md)** and **[free(3)](/free/3.md)** are used for allocation and releasing workloads. *gearman\_worker\_set\_workload\_malloc\_fn()* and *gearman\_worker\_set\_workload\_free\_fn()* can be used to replace these with custom functions.

If you need to remove a function from the server you can call either *gearman\_worker\_unregister\_all()* to remove all functions that the worker has told the **gearmand** server about, or you can use *gearman\_worker\_unregister()* to remove just a single function.

## RETURN

Various

## HOME

To find out more information please check: *https://gearman.org/gearmand/*

## SEE ALSO

**[gearmand(8)](/gearmand/8.md)** **[libgearman(3)](/libgearman/3.md)**

## AUTHOR

Data Differential http://www.datadifferential.com/

## COPYRIGHT

2011-2014, Data Differential, http://www.datadifferential.com/
