GEARMAN_WORKER_UNREGISTER_ALL(3)

πŸ’– GEARMAN_WORKER_UNREGISTER_ALL πŸ’–

okay so bestie, welcome to the Gearmand manual, section 3 (that's the library-call girlies πŸ’…). pull up a chair, grab a boba, and let's get you fluent in worker management, no cap.


✨ NAME ✨

gearman_worker_unregister_all β€” it's Gearmand Documentation, and the link is <http://gearman.info/> 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <libgearman/gearman.h>

type gearman_worker_st

type gearman_worker_set_task_context_free_fn

int gearman_worker_timeout(gearman_worker_st *worker)

void gearman_worker_set_timeout(gearman_worker_st *worker, int timeout)

void *gearman_worker_context(const gearman_worker_st *worker)

void gearman_worker_set_context(gearman_worker_st *worker, void *context)

void gearman_worker_set_workload_malloc_fn(gearman_worker_st *worker, gearman_malloc_fn <#c.gearman_malloc_fn> *function, void *context)

void gearman_worker_set_workload_free_fn(gearman_worker_st *worker, gearman_free_fn <#c.gearman_free_fn> *function, void *context)

gearman_return_t <#c.gearman_return_t> gearman_worker_wait(gearman_worker_st *worker)

gearman_return_t <#c.gearman_return_t> gearman_worker_register(gearman_worker_st *worker, const char *function_name, uint32_t <#c.uint32_t> timeout)

gearman_return_t <#c.gearman_return_t> gearman_worker_unregister(gearman_worker_st *worker, const char *function_name)

gearman_return_t <#c.gearman_return_t> gearman_worker_unregister_all(gearman_worker_st *worker)

void gearman_job_free_all(gearman_worker_st *worker)

bool gearman_worker_function_exist(gearman_worker_st *worker, const char *function_name, size_t <#c.size_t> function_length)

gearman_return_t <#c.gearman_return_t> gearman_worker_work(gearman_worker_st *worker)

gearman_job_st <#c.gearman_job_st> *gearman_worker_grab_job(gearman_worker_st *worker, gearman_job_st <#c.gearman_job_st> *job, gearman_return_t <#c.gearman_return_t> *ret_ptr)

and like, link it with -lgearman or it's giving undefined reference 😭


🌸 DESCRIPTION 🌸

gearman_worker_st is the whole vibe for a worker talking to the server. it's you and the gearmand server, texting. πŸ’¬

gearman_worker_context() and gearman_worker_set_context() let you stash literally any arbitrary object in there for the user. your little secret pocket. πŸŽ€

gearman_worker_set_task_context_free_fn() sets a trigger β€” a lil callback β€” that gets called when a gearman_task_st <#c.gearman_task_st> is released. so when the task leaves the chat, this fires. πŸ‘‹

gearman_worker_timeout() and gearman_worker_set_timeout() get and set the current timeout value for the worker, in milliseconds. note the unit, bestie, milliseconds, not seconds, i'm begging πŸ™

gearman_worker_function_exist() tells you whether a given worker has a specific function. it's the vibe check for functions. βœ…

gearman_worker_work() has the worker execute against jobs until an error occurs. it just keeps going and going until something goes wrong. main character energy fr fr πŸ”₯

gearman_worker_grab_job() takes a job from one of the job servers. and here's the important part β€” it is the responsibility of the caller to free the job once they're done with it. don't leave that job hanging, that's a leak πŸ’€. also, ngl, this interface is used in testing, and it is very rarely the correct interface to program against. so like... be careful, iykyk.

normally malloc(3) and free(3) handle the allocation and releasing of workloads. gearman_worker_set_workload_malloc_fn() and gearman_worker_set_workload_free_fn() can swap those out for custom functions if you want your own ✨custom✨ allocator. you do you, boo.

if you need to remove a function from the server, you've got two options:

  • call gearman_worker_unregister_all() to remove all the functions that the worker has told the gearmand server about β€” the full unfollow, the block, the everything πŸ’…
  • or use gearman_worker_unregister() to remove just a single function. one at a time, subtle, classy. 🌸

⭐ RETURN ⭐

Various. that's it. that's the whole answer. it's giving mysterious. πŸ™ˆ


🏠 HOME 🏠

to find out more information please check: <http://gearman.info/> β€” it's the mothership, go say hi πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€


πŸ‘‘ Author πŸ‘‘

Data Differential <http://www.datadifferential.com/>


2011-2014, Data Differential, http://www.datadifferential.com/


ok that's the whole page bestie, you ate that 🫢 go forth and unregister responsibly, and remember: free your jobs, respect the milliseconds, and never ignore a return value. periodt. ✨

version 1.1.21+ds πŸŽ€ Feb 04, 2026 🌈 mwah, love u, bye πŸ’–

πŸ“¦ where this page comes from