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 the gearman_task_st. the context is literally there so you can pass information to a gearman_task_st 🫢
  • gearman_task_context() returns 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() hands you the size of that value. gearman_task_take_data() is the same as gearman_task_data(), but the value it returns must be freed by the client with free(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(), and gearman_task_denominator() return values related to the last status update that was made to the gearman_task_st. they do not cause the gearman_task_st to 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 the gearman_task_st encountered. gearman_task_return() returns the last gearman_return_t stored. and a value of GEARMAN_UNKNOWN_STATE 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 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/> πŸ’–

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