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 πŸ¦‹

gearmand(8) libgearman(3)


πŸ‘‘ Author πŸ‘‘

Data Differential <http://www.datadifferential.com/>

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