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 calling gearman_client_task_free_all() you can end up with a SEGFAULT if you try to use any gearman_task_st that 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/>

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