GEARMAN_CLIENT...LOW_BACKGROUND(3)
π GEARMAN_CLIENT...LOW_BACKGROUND π
okay bestie, welcome to the Gearmand manual, section 3 (library calls, the girlies who link things). This page is literally three whole functions that live in the same vibe, so let's get into it β¨
πΈ NAME πΈ
gearman_client_add_task_low_background β Gearmand Documentation, http://gearman.info/
she's the low-priority background task adder, and she brought her sisters π
β¨ SYNOPSIS β¨
first things first, you gotta include the header:
#include <libgearman/gearman.h>
and here are the three icons themselves, all matching, all gorgeous:
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 build, you link with -lgearman. no cap π«Ά
π DESCRIPTION π
so gearman_client_add_task_background() creates a background task and adds it into the given gearman_client_st. key detail alert: the task does not start executing until you call gearman_client_run_tasks(). it just sits there, patiently, main character waiting for her cue π
if the unique value isn't set, then a unique will be assigned for you. the library is being nice, let her cook.
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. that's it, that's the whole difference. priorities, bestie, it's giving VIP section vs. general admission π
π Warning π
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().
fr fr, this one MATTERS. stack-allocated gearman_task_st plus this function is a whole ABI safety hazard, and if you go down that road you are legally (well, morally) obligated to gearman_task_free() it. do not skip that step, I am begging π
π RETURN VALUE π
the gearman_task_st gets created, and a pointer to it comes back to you. slay, mission accomplished β¨
but if there's an error, NULL is returned and ret_ptr gets set with a gearman_return_t. so like, always check, okay? check the pointer, check ret_ptr, be a responsible icon π¦
π HOME π
want more lore? go look at 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/
anyway that's the page!! this one is version 1.1.21+ds and it's dated Feb 04, and the year got a lil squished by GEARMAN_CLIENT...LOW_BACKGROUND(3) down at the bottom of the original β she's got range, she's got ABI warnings, she's got it all. go free your tasks, love you, bye ππ§β
π¦ 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