GEARMAN_TASK_RECV_DATA(3)
π NAME π
gearman_task_recv_data β Gearmand Documentation, <http://gearman.info/>
okay bestie, real talk: this whole page is you getting acquainted with the gearman_task_st bestie, and it's a lot of functions but I promise it slaps. this is the libgearman(3) / gearmand(8) corner of the universe. π
β¨ 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 yeah, you link with -lgearman π«Ά
π DESCRIPTION π
so. a gearman_task_st represents a task <#term-task>. like, the whole concept. work that a client <#term-client> ships off to a gearman server shows up as a task β and heads up, a worker <#term-worker> meets that same task in the form of a job <#term-job>. same energy, different name, iykyk.
tasks (aka gearman_task_st) get created by calling 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 plot twist: gearman_client_add_task_status() <#c.gearman_client_add_task_status> can also create a gearman_task_st πΈ β except those ones exist to monitor a gearman_task_st you already made earlier. surveillance era, honestly.
gearman_task_free() is your cleanup bestie β it frees a task. you only really need it if the task was created with a preallocated structure, or if you're just feeling tidy and want to nuke the memory of one specific task.
gearman_task_set_context() sets the context of that gearman_task_st. the context is your little pocket for passing information into a gearman_task_st. π
gearman_task_context() hands back the context that was used when the gearman_task_st was created (or whatever you set with gearman_task_set_context().
gearman_task_data() returns the current data that's been returned to the task. gearman_task_data_size() gives you the size of that value. gearman_task_take_data() does the same thing as gearman_task_data() BUT π the value it returns has to be freed by the client with free(3). don't forget, bestie, that's a leak otherwise. gearman_task_recv_data() is the one you reach for when you've got pre-allocated buffers.
gearman_task_is_known(), gearman_task_is_running(), gearman_task_numerator(), and gearman_task_denominator() return values tied to the last status update made to the gearman_task_st. important: they do not make the gearman_task_st update itself. no cap. it just reports.
gearman_task_error() returns the last error message the gearman_task_st ran into. gearman_task_return() returns the last gearman_return_t <#c.gearman_return_t> that got stored. and if that value is GEARMAN_UNKNOWN_STATE <#c.GEARMAN_UNKNOWN_STATE>? that means 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 listen β values returned by gearman_task_take_data() must have free(3) called on them. periodt.
π HOME π
want more? go look: <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, babe β this was version 1.1.21+ds, dated Feb 04, 2026 β¨ go forth and slay your tasks ππ
π¦ 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