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 calling gearman_client_task_free_all() can leave you with a SEGFAULT if you try to use any gearman_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/>

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