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 the 0.21 glow-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/

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