GEARMAN_TASK_FUNCTION_NAME(3)
π NAME π
okay bestie, welcome to the gearman_task_function_name page π it's a section-3 manual page (that's library-call territory, for the uninitiated) and it lives in the Gearmand manual. Official docs live at <http://gearman.info/> and yes that is the whole NAME entry, we keep it simple here.
β¨ 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 <#c.uint32_t> gearman_task_numerator(const gearman_task_st *task)
uint32_t <#c.uint32_t> gearman_task_denominator(const gearman_task_st *task)
void gearman_task_give_workload(gearman_task_st *task, const void *workload, size_t <#c.size_t> workload_size)
size_t <#c.size_t> gearman_task_send_workload(gearman_task_st *task, const void *workload, size_t <#c.size_t> workload_size, gearman_return_t <#c.gearman_return_t> *ret_ptr)
const void *gearman_task_data(const gearman_task_st *task)
size_t <#c.size_t> gearman_task_data_size(const gearman_task_st *task)
void *gearman_task_take_data(gearman_task_st *task, size_t <#c.size_t> *data_size)
size_t <#c.size_t> gearman_task_recv_data(gearman_task_st *task, void *data, size_t <#c.size_t> data_size, gearman_return_t <#c.gearman_return_t> *ret_ptr)
const char *gearman_task_error(const gearman_task_st *task)
Added in version 0.21. π±
gearman_return_t <#c.gearman_return_t> gearman_task_return(const gearman_task_st *task)
Added in version 0.21. π±
and when you compile, link with -lgearman π«Ά
π DESCRIPTION π
A gearman_task_st represents a task <#term-task>. Here's the vibe: when a client <#term-client> sends work off to a gearman server, that work shows up as a task β and a worker <#term-worker> gets it in the form of a job <#term-job>. That's the whole relationship, no cap.
Tasks (again, that's gearman_task_st) get created by calling any one of these:
gearman_execute()<#c.gearman_execute>gearman_client_add_task()<#c.gearman_client_add_task>gearman_client_add_task_background()<#c.gearman_client_add_task_background>
and also gearman_client_add_task_status() <#c.gearman_client_add_task_status> can make a gearman_task_st β those ones are there to monitor a gearman_task_st you already made earlier π
gearman_task_free() is how you free a task. Now, lowkey important: you only 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.
gearman_task_set_context() sets the given context on the gearman_task_st. The context is your little carrier pigeon β you can use it to pass information to a gearman_task_st.
gearman_task_context() hands back the context that was used when the gearman_task_st was created (or the one that 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 β and this is the plot twist β the value it returns must be freed by the client (free(3)). gearman_task_recv_data() is the one you reach for with pre-allocated buffers.
Now the status squad: gearman_task_is_known(), gearman_task_is_running(), gearman_task_numerator(), and gearman_task_denominator() all return values related to the last status update that was made to the gearman_task_st. And listen β they do not cause the gearman_task_st to update itself. They're reporting, not refreshing, bestie. π§
gearman_task_error() returns the last error message that the gearman_task_st ran into. gearman_task_return() returns the last gearman_return_t <#c.gearman_return_t> that got stored. And a value of GEARMAN_UNKNOWN_STATE <#c.GEARMAN_UNKNOWN_STATE> means the task has not been submitted to a server yet β or that no function was available if the job has been submitted. π
π RETURN VALUE π
Various. β¨ But fr fr: any values that come back from gearman_task_take_data() must have free(3) called on them.
π¦ HOME π¦
To find out more information please check: <http://gearman.info/>
π SEE ALSO π
π Author π
Data Differential <http://www.datadifferential.com/>
πΈ Copyright πΈ
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's a wrap, bestie π this was 1.1.21+ds, dated Feb 04, 2026 β page GEARMAN_TASK_FUNCTION_NAME(3), served fresh π you ate, go call gearman_task_free() on your way out π
π¦ 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