GEARMAN_CLIENT_TIMEOUT(3)
π GEARMAN_CLIENT_TIMEOUT(3) π
okay bestie, sit down, hydrate, and let me tell you about gearman_client_timeout β it's a Gearmand manual page, from the GEARMAN_CLIENT_TIMEOUT(3) corner of the docs, and it's genuinely so much more than the timeout function it's named after. the way this page is secretly a whole client-API starter pack?? iconic. β¨
πΈ NAME πΈ
gearman_client_timeout β Gearmand Documentation, <http://gearman.info/>
β¨ SYNOPSIS β¨
first things first, you gotta pull in the header, no cap:
#include <libgearman/gearman.h>
then we've got the types we're working with:
type gearman_client_st
type gearman_task_context_free_fn
and here's the whole lineup of functions on this page, bestie:
int gearman_client_timeout(gearman_client_st *client)
void gearman_client_set_timeout(gearman_client_st *client, int timeout)
void *gearman_client_context(const gearman_client_st *client)
void gearman_client_set_context(gearman_client_st *client, void *context)
void gearman_client_set_workload_malloc_fn(gearman_client_st *client,
gearman_malloc_fn *function, void *context)
β οΈ Deprecated since version 0.23: Use gearman_allocator_t instead, fr fr.
void gearman_client_set_workload_free_fn(gearman_client_st *client,
gearman_free_fn *function, void *context)
β οΈ Deprecated since version 0.23: Use gearman_allocator_t too. same energy, same warning. π
void gearman_client_task_free_all(gearman_client_st *client)
void gearman_client_set_task_context_free_fn(gearman_client_st *client,
gearman_task_context_free_fn *function)
and when you link it up:
Link with -lgearman
π¦ DESCRIPTION π¦
so gearman_client_st is the whole vibe for client communication with the server. that's its job. that's its purpose. main character energy. π
gearman_client_context() and gearman_client_set_context() are your little storage locker β you can stash an arbitrary object in there, for the user, whatever you want. your snacks, your secrets, your struct. π
gearman_client_set_task_context_free_fn() sets a trigger that's gonna get called when a gearman_task_st is released. it's giving cleanup crew, but make it callback. π
gearman_client_timeout() and gearman_client_set_timeout() get and set the current connection timeout value for the client β and heads up, it's in milliseconds. so like, tiny units. precision era. β±οΈ
normally malloc(3) and free(3) handle allocating and releasing workloads. but if you want, gearman_client_set_workload_malloc_fn() and gearman_client_set_workload_free_fn() let you swap those out for your own custom functions. BUT β and I cannot stress this enough β these have been deprecated, so please go look at gearman_allocator_t for the updated interface. the old way is not the moment anymore. β¨
gearman_client_task_free_all() frees all the current gearman_task_st that have been created with the gearman_client_st. it's the big sweep. every task, gone. π
π¨ Warning: By callinggearman_client_task_free_all()you can end up with a SEGFAULT if you try to use anygearman_task_stthat you have kept pointers to. like, literally, do NOT touch those pointers afterwards. this is the dangerous part, bestie, I'm serious. π
β RETURN VALUE β
gearman_client_timeout() returns an integer representing the amount of time in milliseconds to wait for a connection before throwing an error. so it's basically "how long am I willing to wait for you" energy. π«Ά
and a value of -1? that means an infinite timeout value. no clock, no deadline, just vibes. forever. π
π HOME π
wanna know more, cutie? go check out: <http://gearman.info/>
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 one's version 1.1.21+ds, dated Feb 04, 2026, brought to you by the GEARMAN_CLIENT_TIMEOUT(3) girlies over in Gearmand land. go set your timeout, guard your pointers, and slay π
β¨ π¦
π¦ 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