GEARMAN_WORKER_TIMEOUT(3)
π GEARMAN_WORKER_TIMEOUT π
okay bestie, welcome to GEARMAN_WORKER_TIMEOUT(3) β yes it's the Gearmand manual, section 3, and yes it's literally all about the worker side of libgearman π«Ά the docs live at http://gearman.info/ so go peek if you want more, but everything you need is right here. sit down, hydrate, let's go β¨
πΈ 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)
Link with -lgearman
β¨ DESCRIPTION β¨
gearman_worker_st is the whole vibe β it's what a worker uses to talk to the server. π
gearman_worker_context()andgearman_worker_set_context()β use these to stash literally whatever arbitrary object you want for the user. your little pocket dimension, no cap.gearman_worker_set_task_context_free_fn()β sets a trigger that gets called whenever agearman_task_st<#c.gearman_task_st> is released. it's giving cleanup crew on standby π§Ήgearman_worker_timeout()andgearman_worker_set_timeout()β get and set the current timeout value, in milliseconds, for the worker. β±οΈgearman_worker_function_exist()β checks whether a given worker has a specific function. yes/no, is it there, lowkey iconic.gearman_worker_work()β makes the worker execute against jobs until an error occurs. main character energy: it just keeps going until something goes wrong πgearman_worker_grab_job()β takes a job from one of the job servers. and listen: it is the responsibility of the caller to free the job once they are done π. also, heads up bestie β this interface is used in testing, and is very rarely the correct interface to program against. fr fr, don't build your whole life on it.- normally
malloc(3)andfree(3)handle allocation and releasing of workloads.gearman_worker_set_workload_malloc_fn()andgearman_worker_set_workload_free_fn()let you swap those out for custom functions if you're feeling extra π - need to remove a function from the server? two paths, pick your fighter:
gearman_worker_unregister_all()β nukes all functions that the worker has told thegearmandserver about πgearman_worker_unregister()β removes just a single function, surgical, precise, slay π
π₯ RETURN π₯
Various β yeah. that's it. that's the whole sentence. the manpage said "various" and we respect the mystery π
π¦ HOME π¦
to find out more information please check: http://gearman.info/
β SEE ALSO β
π AUTHOR π
Data Differential http://www.datadifferential.com/
π COPYRIGHT π
2011-2014, Data Differential, http://www.datadifferential.com/
cute sign-off time: this wasGEARMAN_WORKER_TIMEOUT(3), version1.1.21+ds, datedFeb 04, 2026. go forth and make your workers do the thing, bestie π«Άβ¨
π¦ 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