GEARMAN_WORKER_FREE(3)
πΈ GEARMAN_WORKER_FREE π
okay bestie, sit down, hydrate, and let me tell you about gearman_worker_free β it's a page from the Gearmand docs (yes, that Gearmand, the GEARMAN_WORKER_FREE(3) one), and honestly it's giving "clean up your room" energy. β¨
β¨ NAME β¨
gearman_worker_free β Gearmand Documentation, http://gearman.info/ π«Ά
π SYNOPSIS π
#include <libgearman/gearman.h>
gearman_worker_st <#c.gearman_worker_st>
*gearman_worker_create(gearman_worker_st <#c.gearman_worker_st> *client)
gearman_worker_st <#c.gearman_worker_st>
*gearman_worker_clone(gearman_worker_st <#c.gearman_worker_st> *client,
const gearman_worker_st <#c.gearman_worker_st> *from)
void gearman_worker_free(gearman_worker_st <#c.gearman_worker_st>
*client)
And don't forget to link it, babe:
Link with -lgearman
π DESCRIPTION π
sooo, three functions, one little squad. let's do the vibe check one at a time π
gearman_worker_create() β this is your girl for making a gearman_worker_st structure, and that structure is what all the other libgearman(3) client functions use to talk to the server. no structure, no chatting, periodt. you've got two choices: hand it a statically declared gearman_worker_st, or hand it a NULL. and if you pass in that NULL? don't worry, a structure gets allocated for you. the universe provides π¦
gearman_worker_clone() β basically gearman_worker_create()'s cousin. it does the same-ish thing but it copies the defaults and the list of servers from the source gearman_worker_st. cute, right? and if you pass a null as the source argument to clone, it's literally the same as calling gearman_worker_create(). if the destination argument is NULL, a gearman_worker_st will be allocated for you. so many free allocations, we love a generous API β¨
gearman_worker_free() β when you're done with your gearman_worker_st structure, pass it here to clean up the memory. and listen, bestie, this is the only way to make sure all the memory is deallocated when you finish using the structure. not "one of the ways". the only way. it's giving sole survivor π
β οΈ lowkey important warning: you may want to avoid usinggearman_worker_create()orgearman_worker_clone()with a stack based allocation β like, that first parameter. the most common issues related to ABI safety involve heap allocated structures. so, yeah, keep it on the heap, okay? your future self will thank you π«Ά
π RETURN VALUE π
gearman_worker_create()returns a pointer to thegearman_worker_stthat was created (or initialized). if the allocation fails? it returnsNULL. sad but true πgearman_worker_clone()returns a pointer to thegearman_worker_stthat was created (or initialized). and yeah, on an allocation failure it also returnsNULL. same energy, sameNULLπ
π HOME π
want more lore? check it out: http://gearman.info/
see also, besties: gearmand(8) libgearman(3) gearman_strerror(3) π
π Author π
Data Differential http://www.datadifferential.com/
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page, no cap π this was Gearmand manual material, version 1.1.21+ds, dated Feb 04, 2026, filed under GEARMAN_WORKER_FREE(3) β go forth and free your workers, bestie, and remember: heap allocated, always ππ
β¨
π¦ 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