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/>
π Copyright π
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
- 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