GEARMAN_TASK_DATA(3)
β¨ NAME β¨
gearman_task_data β okay bestie this is the Gearmand Documentation page and the link is <http://gearman.info/> π (yes the manual is literally named after the function, she's the main character fr)
it's part of the Gearmand manual, section 3 π
π¦ 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)
πΈ Added in version 0.21.
gearman_return_t gearman_task_return(const gearman_task_st *task)
πΈ Added in version 0.21.
and when you link this whole thing up, you go:
Link with -lgearman
(lowkey the -lgearman is non-negotiable, don't forget her π
)
π DESCRIPTION π
okay so a gearman_task_st represents a task. it's giving "the vibe of a unit of work." when a client sends work to a gearman server, that work is seen as a task β and a worker receives a task in the form of a job π«Ά (same energy, different name, iykyk).
tasks, i.e. gearman_task_st, are created by calling either gearman_execute(), gearman_client_add_task(), or gearman_client_add_task_background(). pick your fighter β¨
gearman_client_add_task_status() can also create gearman_task_st β and these tasks get used to monitor a previously created gearman_task_st. it's the stalker-friend of the group chat, but make it useful π
gearman_task_free() is the one that frees a task. and bestie, you only need to do this if a task was created with a preallocated structure, or if you wanna clean up the memory of one specific task. no random freaking, she has a purpose π
gearman_task_set_context() sets the given context of the gearman_task_st. the context can be used to pass information to a gearman_task_st β lil messenger bag for your data, obsessed π
gearman_task_context() returns the context that was used in the creation of the gearman_task_st (or that was set with gearman_task_set_context(). yes that sentence ends right there, we don't ask questions π
gearman_task_data() returns the current data that has been returned to the task. gearman_task_data_size() will give you the size of the value β so you know exactly how much data you're holding, no guessing π
gearman_task_take_data() is the same as gearman_task_data() BUT the value that is returned must be freed by the client (free(3)). yes bestie, YOU own that memory now, it's your responsibility, no takebacks π
gearman_task_recv_data() can be used with pre-allocated buffers β bringing your own container, very prepared of you β¨
gearman_task_is_known(), gearman_task_is_running(), gearman_task_numerator(), and gearman_task_denominator() return values related to the last status update that was made to the gearman_task_st.
β οΈ okay this is the important part: they do NOT cause the gearman_task_st to update itself. they are a vibe check on stale info, not a refresh. do not @ me.
gearman_task_error() returns the last error message that the gearman_task_st encountered. gearman_task_return() returns the last gearman_return_t stored β the receipts, basically π§Ύ
a value of GEARMAN_UNKNOWN_STATE means that the task has not been submitted to server yet, or that no function was available if the job has been submitted. so like... either she hasn't left the house or nobody was home to receive her. sad but true π
πΈ RETURN VALUE πΈ
Various. it's giving mysterious, she contains multitudes π¦
π¨ but NO CAP: values that are returned bygearman_task_take_data()must havefree(3)called on them. every single time. periodt.
π HOME π
to find out more information please check: <http://gearman.info/> β that's the house, come thru π
π SEE ALSO π
(the rest of the friend group, go say hi π«Ά)
π Author π
Data Differential <http://www.datadifferential.com/>
π Copyright π
2011-2014, Data Differential, <http://www.datadifferential.com/>
and that's the whole page bestie, stay slay, keep your pointers freed β¨
this was version 1.1.21+ds, dated Feb 04, 2026, from the GEARMAN_TASK_DATA(3) page β mwah, go build something iconic ππ
π¦ 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