GEARMAN_TASK_IS_RUNNING(3)
β¨ GEARMAN_TASK_IS_RUNNING β¨
okay bestie, gather round π this is the Gearmand manual page for gearman_task_is_running, straight outta the Gearmand docs at <http://gearman.info/>. It's a libgearman page, it's section 3, and it's lowkey the whole task API in one place. slay.
πΈ 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
π«Ά heads up:gearman_task_error()andgearman_task_return()are the two that got added in version0.21. everyone else was here first. π
π¦ DESCRIPTION π¦
So a gearman_task_st <#term-task> is, like, a task. When a client <#term-client> sends work over to a gearman server, that work shows up as a task β and the worker <#term-worker> on the other end actually receives it in the form of a job <#term-job>. it's giving β¨ pipelines β¨.
Tasks (aka gearman_task_st) get created by calling exactly one of these lil guys:
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. Those particular tasks are used to monitor a gearman_task_st you already made earlier. main character energy: they exist to watch other tasks.
gearman_task_free() is how you free a task. ngl you only need to do this if the task was created with a preallocated structure, or if you specifically want to clean up the memory of one particular task. otherwise? not your problem bestie.
gearman_task_set_context() sets the given context of the gearman_task_st. The context is your little βΏ backpack βΏ β you use it to pass information to a gearman_task_st.
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. gearman_task_data_size() gives you the size of that value. gearman_task_take_data() is literally the same as gearman_task_data() except the value that comes back must be freed by the client with free(3). And gearman_task_recv_data() is the one you reach for when you've got a pre-allocated buffer already.
Now β gearman_task_is_known(), gearman_task_is_running(), gearman_task_numerator(), and gearman_task_denominator() all return values related to the last status update that was made to the gearman_task_st. And this is important, so imma say it loud:
π¨ They do NOT cause the gearman_task_st to update itself. no cap. they just report what they already know, they are not out here refreshing anything. π
gearman_task_error() returns the last error message that the gearman_task_st encountered. gearman_task_return() returns the last gearman_return_t <#c.gearman_return_t> that got stored.
And the plot: a value of GEARMAN_UNKNOWN_STATE <#c.GEARMAN_UNKNOWN_STATE> means the task has not been submitted to the server yet β or, if the job has been submitted, that no function was available. π either way: unknown state, periodt.
π RETURN VALUE π
Various. Various!! π very specific, i know.
But here's the part that actually matters: values that are returned by gearman_task_take_data() must have free(3) called on them. don't forget, or that's a leak 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/>
okay that's the whole page, you ate it, you're welcome π
this was 1.1.21+ds, dated Feb 04, 2026, and it's the GEARMAN_TASK_IS_RUNNING(3) page from the Gearmand docs. go submit a task, queen. β¨π¦π
π¦ 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