GEARMAN_WORKER_SET_TIMEOUT(3)
π NAME π
gearman_worker_set_timeout β Gearmand Documentation, http://gearman.info/
okay bestie, so we're in GEARMAN_WORKER_SET_TIMEOUT(3) territory and honestly? this page is a whole vibe. it's less "one function" and more "the entire worker life, served on a platter" β¨
π 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 then, the moment you've been waiting for β Link with -lgearman π«Ά that's it, that's the link line, go link it.
β¨ DESCRIPTION β¨
so gearman_worker_st is the whole thing your worker uses to yap with the server. main character struct energy fr fr π
gearman_worker_context()andgearman_worker_set_context()let you stash an arbitrary object for the user. a lil pocket for your stuff πgearman_worker_set_task_context_free_fn()sets a trigger that gets called when agearman_task_stis released. like a little goodbye party for your task πgearman_worker_timeout()andgearman_worker_set_timeout()get and set the current timeout value, in milliseconds, for the worker. milliseconds bestie, not seconds, do not play yourself πgearman_worker_function_exist()is how you check whether a given worker actually has a specific function. vibe check, but for functions πgearman_worker_work()has the worker execute against jobs until an error occurs. it just keeps going and going until something breaks π iconic honestlygearman_worker_grab_job()takes a job from one of the job servers. the caller is responsible for freeing the job once they're done β yes YOU, it's your job to free the job, no cap. also worth knowing: this interface is used in testing, and is very rarely the correct interface to program against. so like. it's giving "for the girlies who know" π- normally
malloc(3)andfree(3)handle allocation and releasing workloads. if you want different ones,gearman_worker_set_workload_malloc_fn()andgearman_worker_set_workload_free_fn()will swap in your custom functions. build-a-bear but for memory π§Έ - need to ghost a function on the server? you've got options, bestie:
gearman_worker_unregister_all()β removes all the functions the worker has told the gearmand server about. scorched earth, we love a clean slate π₯gearman_worker_unregister()β removes just a single function. surgical. precise. slay π
πΈ RETURN πΈ
Various
(that's genuinely it. the return values said "Various" and honestly? relatable, same, me too π)
π¦ HOME π¦
To find out more information please check: http://gearman.info/
go, run, don't walk πββοΈβ¨
β SEE ALSO β
π AUTHOR π
Data Differential http://www.datadifferential.com/
π COPYRIGHT π
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page, bestie! this was sitting in version 1.1.21+ds, dated Feb 04, 2026 β so like, recent recent. go forth and set those timeouts in milliseconds πβ¨π«Ά
π¦ 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