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() and gearman_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 a gearman_task_st <#c.gearman_task_st> is released. it's giving cleanup crew on standby 🧹
  • gearman_worker_timeout() and gearman_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) and free(3) handle allocation and releasing of workloads. gearman_worker_set_workload_malloc_fn() and gearman_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:
    1. gearman_worker_unregister_all() β€” nukes all functions that the worker has told the gearmand server about 🌈
    2. 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/

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


cute sign-off time: this was GEARMAN_WORKER_TIMEOUT(3), version 1.1.21+ds, dated Feb 04, 2026. go forth and make your workers do the thing, bestie 🫢✨
πŸ“¦ where this page comes from