GEARMAN_CLIENT_SET_WORKLOAD_FN(3)
π GEARMAN_CLIENT_SET_WORKLOAD_FN π
okay bestie, buckle up, this one lives in the Gearmand manual (that's the manual name, slay) and it's giving "grab a snack, there's a lot of little functions here." π
β¨ NAME β¨
gearman_client_set_workload_fn β Gearmand Documentation, <http://gearman.info/>
like, that's the whole name section. short queen energy. periodt. π
πΈ 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 <#c.gearman_malloc_fn> *function, void *context)
Deprecated since version 0.23: Use gearman_allocator_t <#c
.gearman_allocator_t>
void gearman_client_set_workload_free_fn(gearman_client_st *client,
gearman_free_fn <#c.gearman_free_fn> *function, void *context)
Deprecated since version 0.23: Use gearman_allocator_t <#c
.gearman_allocator_t>
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 then, the moment you've all been waiting for:
Link with -lgearman
no cap, don't forget that linker flag or the vibe check will fail π
π¦ DESCRIPTION π¦
gearman_client_st is the whole entire girl for client communication with the server. that's her job. that's what she does. β¨
gearman_client_context() and gearman_client_set_context() let you stash an arbitrary object for the user β like a lil locker, but for your code. π
gearman_client_set_task_context_free_fn() sets up a trigger that gets called when a gearman_task_st <#c.gearman_task_st> is released. so like, cleanup time, but make it a callback. π§
gearman_client_timeout() and gearman_client_set_timeout() get and set the current connection timeout value, in milliseconds, for the client. yes, milliseconds, not seconds, don't embarrass yourself bestie. π
normally malloc(3) and free(3) handle allocation and releasing workloads. gearman_client_set_workload_malloc_fn() and gearman_client_set_workload_free_fn() let you swap those out for custom functions instead. (but heads up β these have been deprecated, so please go see gearman_allocator_t <#c.gearman_allocator_t> for the updated interface.) π«Ά
gearman_client_task_free_all() frees all the current gearman_task_st <#c.gearman_task_st> that have been created with the gearman_client_st. bye bye babies π
Warning: β οΈ the way that callinggearman_client_task_free_all()can leave you with a SEGFAULT if you try to use anygearman_task_st<#c.gearman_task_st> that you have kept pointers toβ¦ π literally the worst. keep your pointers safe or don't keep them at all, fr fr.
π RETURN VALUE π
gearman_client_timeout() returns an integer representing the amount of time in milliseconds to wait for a connection before throwing an error. and a value of -1 means an infinite timeout value β she waits forever, main character energy honestly. π
π HOME π
to find out more information please check: <http://gearman.info/>
See also:
like, go read your siblings too, they're iconic. π«Ά
π Author π
Data Differential <http://www.datadifferential.com/>
πΈ Copyright πΈ
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's a wrap on the 1.1.21+ds era of this page, dated Feb 04, 2026 π thanks for reading bestie, go forth and link with -lgearman β¨π
π¦ 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