GEARMAN_CLIENT_ST(3)

πŸ’– GEARMAN_CLIENT_ST πŸ’–

ok so bestie, welcome to the Gearmand docs, this is GEARMAN_CLIENT_ST(3) and it's literally the glow-up guide for the client-side struct. grab a boba, we're doing this πŸ§‹βœ¨


✨ NAME ✨

gearman_client_st β€” Gearmand Documentation, http://gearman.info/


✨ SYNOPSIS ✨

#include <libgearman/gearman.h>

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)
Deprecated since version 0.23: use gearman_allocator_t instead, bestie, that's the updated interface πŸ™ˆ
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 instead πŸ’…
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, you link with:

-lgearman

🌸 DESCRIPTION 🌸

gearman_client_st is the whole vibe for client communication with the server. it's giving main character energy, it's the struct doing the talking. πŸ‘‘


πŸŽ€ context stuff

gearman_client_context() and gearman_client_set_context() are your little storage cubby β€” you can stash an arbitrary object in there for the user. your stuff, your rules. 🫢


πŸŽ€ task context free fn

gearman_client_set_task_context_free_fn() sets a trigger that gets called when a gearman_task_st is released. so like, cleanup callback, but make it cute. ✨


πŸŽ€ timeouts

gearman_client_timeout() and gearman_client_set_timeout() are the getter/setter duo for the current connection timeout value, measured in milliseconds, for the client. it's a matched set, they ate. πŸ’…


πŸŽ€ custom malloc / free (the deprecated era)

normally malloc(3) and free(3) are what handle allocating and releasing workloads. but gearman_client_set_workload_malloc_fn() and gearman_client_set_workload_free_fn() let you swap those out for custom functions, if that's your thing. (these have been deprecated, so please go look at gearman_allocator_t for the updated interface, i'm begging 😭)


πŸŽ€ free all the tasks

gearman_client_task_free_all() frees all the current gearman_task_st that were created with the gearman_client_st. spring cleaning but for tasks 🧹✨

⚠️ Warning ⚠️ if you call gearman_client_task_free_all() you can end up with a SEGFAULT πŸ’€ if you try to use any gearman_task_st that you kept pointers to. so like. don't do that. this is the one time we're being dead serious, bestie, no cap.

⭐ RETURN VALUE ⭐

gearman_client_timeout() returns an integer representing the amount of time in milliseconds to wait for a connection before throwing an error.

a value of -1 means an infinite timeout value β€” literally forever, iconic. πŸ‘‘


πŸ¦‹ 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/


and that's the whole page, periodt πŸ’– this was version 1.1.21+ds, dated Feb 04, 2026, and it came to you straight from the GEARMAN_CLIENT_ST(3) man page. mwah, go build something slay πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from