GEARMAN_TASK_DATA_SIZE(3)
π GEARMAN_TASK_DATA_SIZE π
okay so bestie, welcome to the Gearmand manual, section 3 β yes it's literally called GEARMAN_TASK_DATA_SIZE(3) and yes there's a LOT of cousins in here too. grab a snack. π
πΈ NAME πΈ
gearman_task_data_size β Gearmand Documentation, http://gearman.info/ β¨
π SYNOPSIS π
start with the include, always:
#include <libgearman/gearman.h>
then the whole squad of task functions, fr fr:
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 like, don't forget the link step:
Link with -lgearman
π¦ DESCRIPTION π¦
A gearman_task_st represents a <term>task</term>. Work that gets sent by a <term>client</term> to a gearman server is seen as a task (and a <term>worker</term> receives that task in the form of a <term>job</term>). π
Tasks β as in, your gearman_task_st β are created by calling either gearman_execute(), gearman_client_add_task(), or gearman_client_add_task_background(). iconic behaviour.
gearman_client_add_task_status() can also create a gearman_task_st, and those tasks get used to monitor a previously created gearman_task_st. it's giving very "watching the watcher" energy π
gearman_task_free() is what you use to free a task. ngl you only need to do this if the task was created with a preallocated structure, or if you want to clean up the memory of one specific task.
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. lowkey so handy.
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()).
gearman_task_data() returns the current data that has been returned to the task, and gearman_task_data_size() will give you the size of the value. 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)). gearman_task_recv_data() can be used 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. β οΈ big important thing: they do not cause the gearman_task_st to update itself. no, they will not refresh it for you. periodt.
gearman_task_error() returns the last error message that the gearman_task_st encountered. gearman_task_return() returns the last gearman_return_t stored. 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. π
β¨ RETURN VALUE β¨
Various. Values that are returned by gearman_task_take_data() must have free(3) called on them. like, do not skip that one bestie. π
π 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, bestie!! π this was version 1.1.21+ds from the Feb 04, 2026 era β slay, ate, no crumbs, go forth and manage your tasks responsibly π¦β¨
π¦ 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