GEARMAN_ACTIONS_T(3)
β¨ GEARMAN_ACTIONS_T β¨
okay bestie, pull up a chair π«Ά this is the libgearman page alllll about callbacks for client execution task states. It lives in the Gearmand Documentation world β you can find the whole thing over at http://gearman.info/ if you wanna vibe-check the source. Let's get into it π
πΈ 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)
also, link against -lgearman or it simply will not build, no cap π§
π DESCRIPTION π
So. These are the callbacks for client execution task states. The whole cast of characters, the friend group of function pointers, if you will π
gearman_client_set_data_fn() sets the callback function that gets called if the server is gonna make a request to the client asking for more data. it's giving "hey bestie send me more" energy.
gearman_client_do_job_handle() gets the job handle for the running task. Use this between repeated gearman_client_do() (and related) calls when you need to get information. literally the in-between moments matter, iykyk.
gearman_client_clear_fn() can be called to remove all the existing gearman_actions_t that have been set. clean slate, fresh start, slay β¨
Then we have the setter squad: 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() β they set callback functions for the different states of execution for a client request. and here's the important bit: each request (that's a creation of gearman_task_st) keeps a copy of the callbacks when it is created. so it's not a shared vibe, it's a personal copy. periodt π
β οΈ heads up:gearman_client_set_exception_fn()will only be called if exceptions are enabled on the server. you turn those on by callinggearman_client_set_server_option().
an example of this, bestie β look how simple:
const char *EXCEPTIONS="exceptions";
gearman_client_set_server_option(client, EXCEPTIONS, strlen(EXCEPTIONS));
see? iconic. π
π RETURN VALUE π
None. that's it, that's the answer, nothing comes back π
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 was from Gearmand version 1.1.21+ds, dated Feb 04, 2026 β thanks for reading, mwah, go write some callbacks π¦π
π¦ 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