GEARMAN_TASK_SET_CONTEXT(3)

πŸ’– GEARMAN_TASK_SET_CONTEXT πŸ’–

okay so before we even start: this lil page lives in the Gearmand manual, section 3 (that's the library functions girlies, not the shell commands), and it's the home of gearman_task_set_context plus her entire entourage. grab a strawberry πŸ“ and let's go.


✨ NAME ✨

gearman_task_set_context β€” Gearmand Documentation, <http://gearman.info/>

no cap, she's the title girl, but the whole squad shows up in this page. 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
heads up bestie: gearman_task_return() and its lil glow-up note came in with version 0.21, and you gotta link with -lgearman or none of this works, periodt.

πŸ¦‹ DESCRIPTION πŸ¦‹

A gearman_task_st represents a task. Work that is sent by a client to a gearman server is seen as a task β€” and a worker receives a task in the form of a job. so: client β†’ task β†’ job β†’ worker. it's giving relay race πŸƒβ™€οΈβœ¨

Tasks, i.e. gearman_task_st, are created by calling either gearman_execute(), gearman_client_add_task(), or gearman_client_add_task_background().

gearman_client_add_task_status() can also create gearman_task_st β€” and these tasks are the ones you use to monitor a previously created gearman_task_st. spy era πŸ•΅οΈβ™€οΈ

gearman_task_free() is used to free a task. You only gotta do this if a task was created with a preallocated structure, or if you want to clean up the memory of a specific task. (yes she's the responsible one.)

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. this is THE girl of the page πŸŽ€

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() 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 β€” that's free(3), don't forget her. 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. πŸ’€ and listen β€” they do not cause the gearman_task_st to update itself. they're reporting the tea, not brewing it.

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. so if you see that, it's not a mystery, it's just ✨not submitted yet✨.

also in the synopsis lineup, but with no extra lore on this page: gearman_task_function_name(), gearman_task_unique(), gearman_task_job_handle(), gearman_task_give_workload(), and gearman_task_send_workload(). they're in the credits, that's all this page says about them 🫢

πŸ’… RETURN VALUE πŸ’…

Various. Values that are returned by gearman_task_take_data() must have free(3) called on them.

yes really, various. and yes really, free(3) on the gearman_task_take_data() returns. don't leak, bestie, that's not the vibe 😭

🏠 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, no notes πŸ’– this was page GEARMAN_TASK_SET_CONTEXT(3) from the Gearmand manual, version 1.1.21+ds, dated Feb 04, 2026 β€” slay, ate, go set some context, mwah 🫢✨

πŸ“¦ where this page comes from