GEARMAN_CLIENT_SET_TASK_CONTEXT_FREE_FN(3)
π GEARMAN_CLIENT_SET_TASK_CONTEXT_FREE_FN π
okay bestie, welcome to the Gearmand manual, page GEARMAN_CLIENT...CONTEXT_FREE_FN(3). this one's giving "one function in the NAME but a whole squad of friends in the SYNOPSIS" and honestly? we love a chaotic ensemble. let's get into it π«Ά
β¨ NAME β¨
gearman_client_set_task_context_free_fn β Gearmand Documentation, <http://gearman.info/>
β¨ SYNOPSIS β¨
here's the whole vibe, copied exactly, no cap:
#include <libgearman/gearman.h>
type gearman_client_st
type gearman_task_context_free_fn
int gearman_client_timeout(gearman_client_st *client)
void gearman_client_set_timeout(gearman_client_st *client, int timeout)
void *gearman_client_context(const gearman_client_st *client)
void gearman_client_set_context(gearman_client_st *client, void
*context)
void gearman_client_set_workload_malloc_fn(gearman_client_st *client,
gearman_malloc_fn <#c.gearman_malloc_fn> *function, void *context)
Deprecated since version 0.23: Use gearman_allocator_t <#c
.gearman_allocator_t>
void gearman_client_set_workload_free_fn(gearman_client_st *client,
gearman_free_fn <#c.gearman_free_fn> *function, void *context)
Deprecated since version 0.23: Use gearman_allocator_t <#c
.gearman_allocator_t>
void gearman_client_task_free_all(gearman_client_st *client)
void gearman_client_set_task_context_free_fn(gearman_client_st *client,
gearman_task_context_free_fn *function)
Link with -lgearman
linking note π β you gotta Link with -lgearman. no linker flag, no function, periodt.
πΈ DESCRIPTION πΈ
so gearman_client_st is the lil' structure the client uses to yap with the server π¬ that's its whole job, that's the assignment, and it ate.
gearman_client_context() and gearman_client_set_context() are the "hold my stuff" duo β you can stash an arbitrary object of your choosing in there for the user. no questions asked, it's your drawer β¨
gearman_client_set_task_context_free_fn() sets a trigger π β it fires when a gearman_task_st gets released. think of it as the cleanup crew that shows up the second the party's over.
gearman_client_timeout() and gearman_client_set_timeout() get and set the client's current connection timeout value, measured in milliseconds β±οΈ very "how long do I wait before I decide this connection is ghosting me."
normally malloc(3) and free(3) handle allocating and releasing workloads. but if you're feeling custom, gearman_client_set_workload_malloc_fn() and gearman_client_set_workload_free_fn() let you swap in your own functions instead π
however β these two have been deprecated, okay? please go look at gearman_allocator_t <#c.gearman_allocator_t> for the updated interface. don't be out here using deprecated APIs in the year of our lord, it's not the moment π
gearman_client_task_free_all() frees every single gearman_task_st that's currently been created with the gearman_client_st. spring cleaning, but make it C π
Warning: π bestie listen to me very carefully β callinggearman_client_task_free_all()can leave you with a SEGFAULT if you then try to use anygearman_task_stthat you kept pointers to. freed memory is not your friend. it's giving ex for a reason. don't text it back.
β RETURN VALUE β
gearman_client_timeout() returns an integer: how many milliseconds it'll wait for a connection before throwing an error. and a value of -1 means an infinite timeout value β i.e. it will simply wait forever, main character energy, no clock, no deadline, no stress π
π¦ HOME π¦
wanna know more? go check out <http://gearman.info/> π
See also:
π Author π
Data Differential <http://www.datadifferential.com/>
π Copyright π
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's the page, bestie β 1.1.21+ds, dated Feb 04, 20β¦ (the original footer got a lil' clipped on the date, rip, but that's literally what it says), brought to you by the fine folks at Gearmand. now go Link with -lgearman and 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