GEARMAN_CLIENT...ASK_BACKGROUND(3)
π GEARMAN_CLIENT...ASK_BACKGROUND(3) π
okay bestie, gather round, because this one is a Gearmand joint (that's manual section 3, the library-call zone, iykyk β¨) and it's literally just Gearmand Documentation, http://gearman.info/ energy from top to bottom.
πΈ NAME πΈ
gearman_client_add_task_background β Gearmand Documentation, http://gearman.info/
π SYNOPSIS π
First things first, you gotta pull in the header:
#include <libgearman/gearman.h>
Then, three lil' besties with the exact same shape, differing only in the priority they're serving:
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)
And when you link it, you link it like this:
-lgearman
periodt. π
β¨ DESCRIPTION β¨
So gearman_client_add_task_background() does exactly what it says on the tin, no cap: it creates a background task and adds it to the gearman_client_st you handed it. But here's the tea β execution of the task does not begin until you call gearman_client_run_tasks(). So it's just vibing in the queue until you say go. π¦
If the unique value isn't set, then a unique will be assigned. Don't stress about it, it gets handled for you. π
Now gearman_client_add_task_high_background() and gearman_client_add_task_low_background() are identical to gearman_client_do(), the only difference being that they set the priority to either high or low. That's it, that's the whole personality shift. π₯
β οΈ Warning, bestie, read this one fr fr: You may wish to avoid usinggearman_client_add_task_background()with a stack based allocatedgearman_task_st. The most common issues related to ABI safety involve stack allocated structures. If you use a stack basedgearman_task_styou must free it withgearman_task_free(). Not optional. Free your task, love yourself. π«Ά
π RETURN VALUE π
The gearman_task_st is created and a pointer to it is returned β it's giving main character. But on error NULL is returned and ret_ptr is set with a gearman_return_t. So yeah, check that ret_ptr, okay? π
π HOME π
To find out more information please check: http://gearman.info/
See also:
gearmand(8)libgearman(3)gearman_task_st
π Author π
Data Differential http://www.datadifferential.com/
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page, babe π this was version 1.1.21+ds, dated Feb 04, 202 (yes the footer date literally got chopped, iconic behavior, we love a cliffhanger π). catch you in the next man page, slay! πΈπ¦β¨
π¦ where this page comes from
- ubuntu resolute: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms