GEARMAN_TASK_SEND_WORKLOAD(3)
β¨ NAME β¨
bestie welcome to the GEARMAN_TASK_SEND_WORKLOAD(3) page from the Gearmand manual π β aka gearman_task_send_workload, the Gearmand Documentation situation over at <http://gearman.info/> πΈ
π SYNOPSIS π
okay so here's the whole squad of declarations, exactly as they come, no edits no cap:
#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.
Link with -lgearman
quick little note bestie: gearman_task_error() and gearman_task_return() are the two glow-up girls, both Added in version 0.21. π
and you gotta Link with -lgearman or it's giving undefined reference energy π
π¦ DESCRIPTION π¦
so a gearman_task_st represents a task π Work that a client ships off to a gearman server is seen as a task β and yeah, a worker receives that task in the form of a job. that's the whole pipeline, periodt.
Tasks, meaning your gearman_task_st, get created by calling any one of these queens:
gearman_execute()gearman_client_add_task()gearman_client_add_task_background()
and also gearman_client_add_task_status() can create a gearman_task_st too β those tasks are the ones you use to monitor a previously created gearman_task_st π slay.
gearman_task_free()frees a task. lowkey you only need to do this if the task was created with a preallocated structure, or if you just wanna clean up the memory of one specific task. no pressure.gearman_task_set_context()sets the given context on thegearman_task_st. the context is literally there so you can pass information to agearman_task_stπ«Άgearman_task_context()returns the context that was used when thegearman_task_stwas created β or the one that was set withgearman_task_set_context().gearman_task_data()returns the current data that has been returned to the task.gearman_task_data_size()hands you the size of that value.gearman_task_take_data()is the same asgearman_task_data(), but the value it returns must be freed by the client withfree(3)π don't forget, bestie.gearman_task_recv_data()is the one you use with pre-allocated buffers β¨gearman_task_is_known(),gearman_task_is_running(),gearman_task_numerator(), andgearman_task_denominator()return values related to the last status update that was made to thegearman_task_st. they do not cause thegearman_task_stto update itself π so don't come for them expecting fresh tea, they're just reading the group chat from last time.gearman_task_error()returns the last error message that thegearman_task_stencountered.gearman_task_return()returns the lastgearman_return_tstored. and a value ofGEARMAN_UNKNOWN_STATEmeans the task hasn't been submitted to the server yet β or, if the job has been submitted, that no function was available π
π RETURN VALUE π
Various. π and okay this is the important bit: values that are returned by gearman_task_take_data() must have free(3) called on them. like actually. go free 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 the whole page babes β¨ it's version 1.1.21+ds, dated Feb 04, 2026, from the GEARMAN_TASK_SEND_WORKLOAD(3) manual β ily, go free your task memory π«Άπ
π
π¦ 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