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/
π Copyright π
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
- 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