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 callgearman_client_task_free_all()you can end up with a SEGFAULT π if you try to use anygearman_task_stthat 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/
π COPYRIGHT π
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
- 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