---
name: "gearman_client_add_task_background"
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_client_add_task_background"
---

# gearman\_client\_add\_task\_background(3)

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

## NAME

gearman\_client\_add\_task\_background - Gearmand Documentation, https://gearman.org/gearmand/

## SYNOPSIS

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

- ***gearman\_task\_st* \*gearman\_client\_add\_task\_background(*gearman\_client\_st* \*client, *gearman\_task\_st* \*task, void \*context, const char \*function\_name, const char \*unique, const void \*workload, *size\_t* workload\_size, *gearman\_return\_t* \*ret\_ptr)**

  - ***gearman\_task\_st* \*gearman\_client\_add\_task\_high\_background(*gearman\_client\_st* \*client, *gearman\_task\_st* \*task, void \*context, const char \*function\_name, const char \*unique, const void \*workload, *size\_t* workload\_size, *gearman\_return\_t* \*ret\_ptr)**

  - ***gearman\_task\_st* \*gearman\_client\_add\_task\_low\_background(*gearman\_client\_st* \*client, *gearman\_task\_st* \*task, void \*context, const char \*function\_name, const char \*unique, const void \*workload, *size\_t* workload\_size, *gearman\_return\_t* \*ret\_ptr)**

  Link with -lgearman

## DESCRIPTION

*gearman\_client\_add\_task\_background()* creates a background task and adds it ito the given *gearman\_client\_st*. Execution of the task does not begin until *gearman\_client\_run\_tasks()* is called.

If the unique value is not set, then a unique will be assigned.

*gearman\_client\_add\_task\_high\_background()* and *gearman\_client\_add\_task\_low\_background()* are identical to *gearman\_client\_do()*, only they set the priority to either high or low.

Job assignment priority is global across registered functions. A high priority job for any function is assigned before normal or low priority jobs for other functions.

**WARNING:**

You may wish to avoid using *gearman\_client\_add\_task\_background()* with a stack based allocated *gearman\_task\_st*. The most common issues related to ABI safety involve stack allocated structures. If you use a stack based *gearman\_task\_st* you must free it with *gearman\_task\_free()*.

## RETURN VALUE

The *gearman\_task\_st* is created and a pointer to it is returned. On error NULL is returned and ret\_ptr is set with a *gearman\_return\_t*.

## HOME

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

**SEE ALSO:**

**[gearmand(8)](/gearmand/8.md)** **[libgearman(3)](/libgearman/3.md)** **gearman\_task\_st**

## AUTHOR

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

## COPYRIGHT

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