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 β€” calling gearman_client_task_free_all() can leave you with a SEGFAULT if you then try to use any gearman_task_st that 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/>


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