GEARMAN_CLIENT_SET_STATUS_FN(3)

✨ gearman_client_set_status_fn ✨

okay so bestie, welcome to a page from the Gearmand manual (yes that's the manual name, we're in gearmand(3) territory, iykyk) πŸ’– and today we're talking about client callbacks β€” the little functions you hand to libgearman so it knows who to scream at when stuff happens.


🌸 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)

Link to -lgearman 🫢 (that's how you pull the library in, no cap)


πŸ¦‹ DESCRIPTION πŸ¦‹

These are the callbacks for client execution task states, bestie. Like, when your client request is out there living its main character life, these are the little ping notifications telling you what's going on.

  • gearman_client_set_data_fn() β€” sets the callback function that gets called if the server needs to slide into the client's DMs and ask for more data. Yes, the server asks you. Greedy? maybe. Iconic? also maybe.
  • gearman_client_do_job_handle() β€” grabs the job handle for the running task. You're supposed to use this between repeated gearman_client_do() (and related) calls to get information. So like, between rounds of doing the thing, check in on your job's handle okay? πŸ’…
  • gearman_client_clear_fn() β€” call this to ✨ clear out ✨ all the existing gearman_actions_t that have been set. Fresh start, brand new era, clean slate, periodt.

Now the big group of setters πŸ’œ β€” 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() β€” these all set callback functions for the different states of execution for a client request. And here's the tea πŸ“: each request, i.e. a creation of a gearman_task_st, keeps a copy of the callbacks when it is created. So the callbacks are snapshotted at birth, girl. Know that.

⚠️ heads up: gearman_client_set_exception_fn() will only be called if exceptions are enabled on the server. You can do that by calling gearman_client_set_server_option(). It's giving "you must opt in", lowkey.

An example of this:

const char *EXCEPTIONS="exceptions";
gearman_client_set_server_option(client, EXCEPTIONS, strlen(EXCEPTIONS));

slay, that's it, that's the example πŸŽ€


🌈 RETURN VALUE 🌈

None. That's it. Nothing. Zero. Nada. πŸ’€

See also: gearmand(8) libgearman(3) gearman_client_error(3) or gearman_worker_error(3)


πŸ‘‘ Author πŸ‘‘

Data Differential http://www.datadifferential.com/

2011-2014, Data Differential, http://www.datadifferential.com/


and that's the whole page bestie, we ate and left no crumbs 🧚✨ this was 1.1.21+ds from Feb 04, 2026, mwah πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from