GEARMAN_CLIENT_DO_STATUS(3)

πŸ’– GEARMAN_CLIENT_DO_STATUS πŸ’–

okay bestie, this is a page out of the Gearmand manual set (yes, the gearmand crew, they're icons), and we're talking about libgearman's client-side status-and-config situation. it's giving "everything you need to poke at a client object without actually doing a job." let's go 🫢


✨ SYNOPSIS ✨

first things first, you gotta pull in the header, no cap:

#include <libgearman/gearman.h>

then here's the whole roster of types and functions this page is serving you:

type gearman_client_st

type gearman_task_context_free_fn

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)

void gearman_client_set_workload_free_fn(gearman_client_st *client, gearman_free_fn *function, void *context)

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)
⚠️ heads up babes: both gearman_client_set_workload_malloc_fn() and gearman_client_set_workload_free_fn() are Deprecated since version 0.23. use gearman_allocator_t instead, mwah πŸ’…

and when you link, don't forget:

-lgearman

🌸 DESCRIPTION 🌸

so gearman_client_st is the whole vibe for client communication with the server. it's the main character of this page, fr fr.

gearman_client_context() and gearman_client_set_context() are your little storage cubbies πŸŽ€ β€” you can use them to stash an arbitrary object for the user. whatever you wanna keep around, it lives there.

gearman_client_set_task_context_free_fn() sets a trigger β€” think of it like a little alarm that goes off when a gearman_task_st is released. very "notify me when it's over" energy ✨

gearman_client_timeout() and gearman_client_set_timeout() get and set the current connection timeout value, in milliseconds, for the client. tiny numbers, big consequences 😌

normally malloc(3) and free(3) are the ones doing the allocation and releasing of workloads β€” the originals, the classics. but gearman_client_set_workload_malloc_fn() and gearman_client_set_workload_free_fn() can swap those out for your own custom functions instead. however β€” these have been deprecated, so please go look at gearman_allocator_t for the updated interface, i'm begging πŸ₯Ί

gearman_client_task_free_all() frees all the current gearman_task_st that were created with the gearman_client_st. all of them. every last one. periodt.

⚠️ Warning: by calling gearman_client_task_free_all() you can end up with a SEGFAULT πŸ’€πŸ’€ if you then try to use any gearman_task_st that you kept pointers to. like, they're gone now. do not touch. do not pass go. do not dereference. this is not a drill, bestie 😭

πŸ¦‹ RETURN VALUE πŸ¦‹

gearman_client_timeout() returns an integer β€” how long, in milliseconds, to wait for a connection before throwing an error. and if you get a value of -1? that means an infinite timeout value. forever and ever, amen β™ΎοΈβœ¨


🏠 HOME 🏠

wanna know more, boo? go check out: <http://gearman.info/>

See also:


πŸ‘‘ Author πŸ‘‘

Data Differential <http://www.datadifferential.com/>

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


that's the whole page, babe!! πŸŽ€ this was Gearmand version 1.1.21+ds, dated Feb 04, 2026, and the page is GEARMAN_CLIENT_DO_STATUS(3) β€” go forth and configure your clients responsibly πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from