GEARMAN_TASK_IS_KNOWN(3)
β¨ NAME β¨
gearman_task_is_known β Gearmand Documentation, http://gearman.info/
okay so bestie, this whole page lives in the Gearmand manual, section 3 (library functions, iykyk) π
πΈ 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 gearman_task_numerator(const gearman_task_st *task)
uint32_t gearman_task_denominator(const gearman_task_st *task)
void gearman_task_give_workload(gearman_task_st *task, const void *workload, size_t workload_size)
size_t gearman_task_send_workload(gearman_task_st *task, const void *workload, size_t workload_size, gearman_return_t *ret_ptr)
const void *gearman_task_data(const gearman_task_st *task)
size_t gearman_task_data_size(const gearman_task_st *task)
void *gearman_task_take_data(gearman_task_st *task, size_t *data_size)
size_t gearman_task_recv_data(gearman_task_st *task, void *data, size_t data_size, gearman_return_t *ret_ptr)
const char *gearman_task_error(const gearman_task_st *task)
Added in version 0.21.
gearman_return_t gearman_task_return(const gearman_task_st *task)
Added in version 0.21.
Link with -lgearman
not me listing every single function like a girlboss π but fr, that's the whole roster βgearman_task_return()and the0.21glow-up era are marked for you so you know what's vintage and what's new π
π¦ DESCRIPTION π¦
A gearman_task_st represents a task. Here's the tea: work that a client sends to a gearman server shows up as a task. (And a worker receives that same task in the form of a job.) Same energy, different name depending on which side of the conversation you're on π₯
gearman_task_st tasks get created by calling one of these:
gearman_execute()gearman_client_add_task()gearman_client_add_task_background()
And plot twist β 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. It's giving babysitter energy π
gearman_task_free() is how you free a task. And lowkey? 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. No stress otherwise π
gearman_task_set_context() sets the given context of the gearman_task_st. The context is basically your lil backpack β you can use it to pass information to a gearman_task_st π
gearman_task_context() returns the context that was used when the gearman_task_st was created (or whatever got set later 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 the same as gearman_task_data() β except the value it hands back must be freed by the client with free(3). And gearman_task_recv_data() is the one you reach for when you're working with pre-allocated buffers β¨
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 the important part, bestie β they do NOT cause the gearman_task_st to update itself. They're just reporting, not refreshing π
gearman_task_error() returns the last error message that the gearman_task_st ran into. gearman_task_return() returns the last gearman_return_t stored. 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. Both moods, same vibe check π
β RETURN VALUE β
Various. And this part matters: any value returned by gearman_task_take_data() must have free(3) called on it. No cap, don't leak that memory π«Ά
π 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, and it's literally iconic β this was page GEARMAN_TASK_IS_KNOWN(3) from the Gearmand 1.1.21+ds release, dated Feb 04, 2026, so if you're reading this on a later version, go check the fresh one bestie π§β¨ mwah, slay, 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