GEARMAN_CLIENT_SET_COMPLETE_FN(3)
π GEARMAN_CLIENT_SET_COMPLETE_FN β Gearmand Documentation β¨
okay bestie, welcome to the Gearmand docs, straight from http://gearman.info/ π pull up a chair, hydrate, and let's get into how you hand Gearman your callback functions.
πΈ SYNOPSIS πΈ
#include <libgearman/gearman.h>
type gearman_actions_t
type gearman_workload_fn
type gearman_created_fn
type gearman_data_fn
type gearman_warning_fn
type gearman_universal_status_fn
type gearman_exception_fn
type gearman_fail_fn
type gearman_complete_fn
void gearman_client_set_workload_fn(gearman_client_st *client, gearman_workload_fn *function)
void gearman_client_set_created_fn(gearman_client_st *client, gearman_created_fn *function)
void gearman_client_set_data_fn(gearman_client_st *client, gearman_data_fn *function)
void gearman_client_set_warning_fn(gearman_client_st *client, gearman_warning_fn *function)
void gearman_client_set_status_fn(gearman_client_st *client, gearman_universal_status_fn *function)
void gearman_client_set_complete_fn(gearman_client_st *client, gearman_complete_fn *function)
void gearman_client_set_exception_fn(gearman_client_st *client, gearman_exception_fn *function)
void gearman_client_set_fail_fn(gearman_client_st *client, gearman_fail_fn *function)
void gearman_client_clear_fn(gearman_client_st *client)
const char *gearman_client_do_job_handle(gearman_client_st *client)
and fr, don't forget to link against -lgearman π«Ά (that's the whole point of the game)
π¦ DESCRIPTION π¦
so these are the callbacks for client execution task states π like, if your task is a whole main character, these are the moments in her arc that you get to narrate.
gearman_client_set_data_fn()β this one sets the callback function that gets called if the server wants to make a request to the client asking for more data. yes, the server can just... come back and ask for seconds. iconic behavior honestly.gearman_client_do_job_handle()β ngl the manpage typo'd this as "gest", but bestie it gets the job handle for the running task π₯ use it in between repeatedgearman_client_do()(and related) calls when you want to pull information out. lowkey essential.gearman_client_clear_fn()β call this to yeet every single existinggearman_actions_tthat's been set. clean slate, new era β¨
now for the big one. gearman_client_set_created_fn(), gearman_client_set_data_fn(), gearman_client_set_warning_fn(), gearman_client_set_status_fn(), gearman_client_set_complete_fn(), gearman_client_set_exception_fn(), and gearman_client_set_fail_fn() all set callback functions for the different states of execution of a client request π and here's the detail you need to remember: each request β meaning each creation of a gearman_task_st β keeps its own copy of the callbacks at the moment it's created. so like, snapshots. it's giving commitment issues but in a helpful way.
π¨ important!!gearman_client_set_exception_fn()will only be called if exceptions are enabled on the server. no server-side exceptions = your callback is just sitting there, ignored, staring at the wall π you turn them on by callinggearman_client_set_server_option().
here's the vibe, code and all:
const char *EXCEPTIONS="exceptions";
gearman_client_set_server_option(client, EXCEPTIONS, strlen(EXCEPTIONS));
periodt. that's the whole ritual π
β RETURN VALUE β
None. that's it, that's the section, we love a low-effort return value king π
see also:
π Author π
Data Differential β http://www.datadifferential.com/
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page bestie π this lil' baddie shipped as version 1.1.21+ds, dated Feb 04, 2026, brought to you by the GEARMAN_CLIENT_SET_COMPLETE_FN(3) girlies in the Gearmand manual. go set some callbacks, you absolute queen πβ¨π¦
π¦ 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