GEARMAN_TASK_JOB_HANDLE(3)
π¦ NAME π¦
gearman_task_job_handle β Gearmand Documentation, http://gearman.info/
okay so this is page GEARMAN_TASK_JOB_HANDLE(3) from the gearmand manual β section 3 bestie, the library girlies π β and she is all about your task handles and every lil' function that pokes at one. buckle up π«Ά
β¨ 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.
Link with -lgearman
fyi those two "Added in version 0.21." notes are sitting right there in the synopsis for you, no cap π
π DESCRIPTION π
A gearman_task_st represents a task. like β work that a client sends over to a gearman server? that whole thing is seen as a task. and a worker receives a task in the form of a job. that's the whole vibe of it, honestly πΈ
Tasks β yes, the gearman_task_st girlies β get created by calling either:
gearman_execute()gearman_client_add_task()gearman_client_add_task_background()
and gearman_client_add_task_status() can also create a gearman_task_st. those particular tasks get used to monitor a previously created gearman_task_st β like a lil' watchtower situation π
Moving on to the actual functions, bestie:
gearman_task_free()β frees a task. you only need to do this if the task was created with a preallocated structure, or if you just want to clean up the memory of one specific task. lowkey optional, highkey tidy β¨gearman_task_set_context()β sets the given context of thegearman_task_st. the context is there so you can pass information to agearman_task_st. it's giving little backpack π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()will give you the size of the value.gearman_task_take_data()is the same asgearman_task_data(), except the value that comes back must be freed by the client withfree(3).gearman_task_recv_data()is the one you use when you've got pre-allocated buffers already sitting there π
Now the status-update girlies: gearman_task_is_known(), gearman_task_is_running(), gearman_task_numerator(), and gearman_task_denominator() all return values that relate to the last status update that was made to the gearman_task_st.
π¨ IMPORTANT: they do not cause the gearman_task_st to update itself. they just report, bestie. they are not doing the work. π
and finally:
gearman_task_error()β returns the last error message that thegearman_task_stencountered.gearman_task_return()β returns the lastgearman_return_tthat got stored.
A value of GEARMAN_UNKNOWN_STATE means that the task has not been submitted to server yet β or, if the job has been submitted, that no function was available. either way: not it π
π RETURN VALUE π
Various. and listen β values that are returned by gearman_task_take_data() must have free(3) called on them. do not forget. i am begging π«Ά
π 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, dated Feb 04, 2026 β so if you're reading this from the future, hey, slay π go free your task data and hydrate. periodt πΈπ¦
π¦ 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