GEARMAN_CLIENT_SET_CONTEXT(3)

πŸ’– NAME πŸ’–

okay so this is gearman_client_set_context(3) β€” it lives in the Gearmand section of the manual (section 3, the library-call girlies πŸŽ€), and it's all about the Gearman docs over at http://gearman.info/ ✨


🌸 SYNOPSIS 🌸

first things first, bestie, you gotta pull in the header:

#include <libgearman/gearman.h>

and here are the types she's serving:

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

and the actual functions, no cap:

void gearman_client_set_workload_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_workload_fn *function)

void gearman_client_set_created_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_created_fn *function)

void gearman_client_set_data_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_data_fn *function)

void gearman_client_set_warning_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_warning_fn *function)

void gearman_client_set_status_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_universal_status_fn *function)

void gearman_client_set_complete_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_complete_fn *function)

void gearman_client_set_exception_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_exception_fn *function)

void gearman_client_set_fail_fn(gearman_client_st <#c.gearman_client_st> *client, gearman_fail_fn *function)

void gearman_client_clear_fn(gearman_client_st <#c.gearman_client_st> *client)

const char *gearman_client_do_job_handle(gearman_client_st <#c.gearman_client_st> *client)

and don't forget to link against -lgearman πŸ”— (she needs her bestie to run, periodt)


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically? these are the callbacks for client execution task states πŸ’… it's giving "tell me when things happen" energy.

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. she's nosy, she wants the tea 🍡

gearman_client_do_job_handle() β€” gets the job handle for the running task. (yes, the original says "gest", we're just gonna say gets 😭) this one is meant to be used between repeated gearman_client_do() calls (and her related calls) so you can get info out of them. iykyk.

gearman_client_clear_fn() β€” call this when you wanna remove all the existing gearman_actions_t that have been set. full reset, clean slate, iconic 🌈

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 set callback functions for the different states of execution for a client request. and here's the important bit: each request (i.e. a creation of gearman_task_st) keeps a copy of the callbacks when it is created. so like, they snapshot the vibe at creation time πŸ“Έ

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().

here's an example of that:

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

⭐ RETURN VALUE ⭐

none. she returns nothing. main character energy, no receipts πŸ’…

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!! πŸŽ€ this was version 1.1.21+ds from Feb 04, 2026, brought to you by the GEARMAN_CLIENT_SET_CONTEXT(3) girlies β€” go forth and set those contexts, slay βœ¨πŸ’–

πŸ“¦ where this page comes from