GEARMAN_TASK_DENOMINATOR(3)
π GEARMAN_TASK_DENOMINATOR(3) π
okay bestie, gather round π«Ά this is a page straight out of the Gearmand manual, and we're talking about gearman_task_denominator. Yes, the name is long. No, we're not scared of it. Let's go π
β¨ NAME β¨
gearman_task_denominator β Gearmand Documentation, <http://gearman.info/>
πΈ SYNOPSIS πΈ
#include <libgearman/gearman.h>
type gearman_task_st
void gearman_task_free(gearman_task_st *task)
void *gearman_task_context(const gearman_task_st *task)
void gearman_task_set_context(gearman_task_st *task, void *context)
const char *gearman_task_function_name(const gearman_task_st *task)
const char *gearman_task_unique(const gearman_task_st *task)
const char *gearman_task_job_handle(const gearman_task_st *task)
bool gearman_task_is_known(const gearman_task_st *task)
bool gearman_task_is_running(const gearman_task_st *task)
uint32_t gearman_task_numerator(const gearman_task_st *task)
uint32_t gearman_task_denominator(const gearman_task_st *task)
void gearman_task_give_workload(gearman_task_st *task, const void *workload, size_t workload_size)
size_t gearman_task_send_workload(gearman_task_st *task, const void *workload, size_t workload_size, gearman_return_t *ret_ptr)
const void *gearman_task_data(const gearman_task_st *task)
size_t gearman_task_data_size(const gearman_task_st *task)
void *gearman_task_take_data(gearman_task_st *task, size_t *data_size)
size_t gearman_task_recv_data(gearman_task_st *task, void *data, size_t data_size, gearman_return_t *ret_ptr)
const char *gearman_task_error(const gearman_task_st *task)
gearman_return_t gearman_task_return(const gearman_task_st *task)
fun fact for the lore girlies: both gearman_task_error() and gearman_task_return() were Added in version 0.21.
and lastly, when you build: link with -lgearman β¨
π¦ DESCRIPTION π¦
So a gearman_task_st represents a task. The tea is: work gets sent by a client to a gearman server, and that work is seen as a task β meanwhile a worker receives that same task in the form of a job. Same energy, different names, iykyk π
Tasks (aka your gearman_task_st) get created by calling any one of these besties:
gearman_execute()gearman_client_add_task()gearman_client_add_task_background()
And plot twist β gearman_client_add_task_status() can also make a gearman_task_st. Those particular tasks exist to monitor a gearman_task_st you already made earlier. Very main character of them π
gearman_task_free() is what you use to free a task. You only actually need to do this if the task was created with a preallocated structure, or if you just want to clean up the memory of one specific task. No judgement either way π
gearman_task_set_context() sets the given context of the gearman_task_st. The context is basically a little bag you can use to pass information into a gearman_task_st π
gearman_task_context() hands you back the context that was used when the gearman_task_st was created β or whatever was set with gearman_task_set_context().
gearman_task_data() returns the current data that has been returned to the task. gearman_task_data_size() gives you the size of that value. gearman_task_take_data() is the same as gearman_task_data(), BUT the value it returns must be freed by the client with free(3). Don't ghost that free call, fr fr π And if you're the pre-allocated-buffer type? gearman_task_recv_data() is your girl.
okay so these four β gearman_task_is_known(), gearman_task_is_running(), gearman_task_numerator(), and gearman_task_denominator() β they return values that relate to the last status update that was made to the gearman_task_st. Important: they do NOT cause the gearman_task_st to update itself. They just report. Chill observers. No cap π
gearman_task_error() returns the last error message that the gearman_task_st ran into. gearman_task_return() returns the last gearman_return_t that got stored. And heads up β a value of GEARMAN_UNKNOWN_STATE means either the task hasn't been submitted to the server yet, or no function was available if the job has been submitted. Either way, it's giving "we don't know her yet" π
π RETURN VALUE π
Various. Truly a mystery box π But seriously: any values returned by gearman_task_take_data() must have free(3) called on them. Periodt.
π HOME π
Want more info? Go check out: <http://gearman.info/> π
β SEE ALSO β
π Author π
Data Differential <http://www.datadifferential.com/>
π Copyright π
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's the whole page bestie, we ate and left no crumbs ππ
this iconic piece of documentation is from version 1.1.21+ds, dated Feb 04, 2026, and yes β it's the GEARMAN_TASK_DENOMINATOR(3) page from the Gearmand manual. mwah πβ¨
π¦ 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