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 calling gearman_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/

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