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 the gearman_task_st. the context is there so you can pass information to a gearman_task_st. it's giving little backpack πŸŽ’
  • gearman_task_context() β€” returns the context that was used when the gearman_task_st was created (or the one 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(), except the value that comes back must be freed by the client with free(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 the gearman_task_st encountered.
  • gearman_task_return() β€” returns the last gearman_return_t that 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 πŸ‘‘

gearmand(8) libgearman(3)


πŸ’œ AUTHOR πŸ’œ

Data Differential http://www.datadifferential.com/

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