GEARMAN_CLIENT_SET_WARNING_FN(3)
β¨ NAME β¨
gearman_client_set_warning_fn β it's giving Gearmand Documentation energy, bestie π and the docs live at http://gearman.info/ if you wanna go touch grass over there.
πΈ SYNOPSIS πΈ
okay so first things first, you gotta pull in the header:
#include <libgearman/gearman.h>
and then these types??? iconic, we love them all:
type gearman_actions_ttype gearman_workload_fntype gearman_created_fntype gearman_data_fntype gearman_warning_fntype gearman_universal_status_fntype gearman_exception_fntype gearman_fail_fntype gearman_complete_fn
and the functions themselves, right, they all look like this:
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)
and last but never least: you gotta link against -lgearman or nothing works, fr fr π«Ά
π DESCRIPTION π
so basically?? these are the callbacks for client execution task states. the whole vibe. β¨
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. the server is like "bestie give me more" and your callback handles it πgearman_client_do_job_handle()β gets the job handle for the running task. lowkey the important part: this should be used between repeatedgearman_client_do()(and related) calls to get information. so like, in the gap between them, not randomly mid-call, okay?? π€gearman_client_clear_fn()β you can call this to remove all existinggearman_actions_tthat have been set. full reset, clean slate, era ended π§Ήβ¨
okay and now the big group: 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, ie a creation of gearman_task_st, keeps a copy of the callbacks when it is created. a copy!! so it's not vibing off your live changes later, she took a screenshot and moved on πΈ
also important queen: 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 what that looks like in practice, no cap:
const char *EXCEPTIONS="exceptions";
gearman_client_set_server_option(client, EXCEPTIONS, strlen(EXCEPTIONS));
like. look at her go. π
π RETURN VALUE π
None β nothing, zero, nada, she returns the void and the void is fine π«§
See also:
π Author π
Data Differential http://www.datadifferential.com/ β the icons themselves π
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/ β respect the elders, protect the legacy π₯Ή
and that's the whole page babes, we did it π this was pulled from the 1.1.21+ds era of the Gearmand manual, dated Feb 04, 2026, and it's officially titled GEARMAN_CLIENT_SET_WARNING_FN(3). go forth and set those callbacks, bestie π¦β¨
π¦ 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