GEARMAN_JOB_USE_CLIENT(3)

πŸ’– GEARMAN_JOB_USE_CLIENT πŸ’–

okay bestie, welcome to the GEARMAN_JOB_USE_CLIENT(3) page from the Gearmand manual 😌✨ pull up a chair, grab a strawberry πŸ“, we're gonna talk about jobs.


🌸 SYNOPSIS 🌸

#include <libgearman/gearman.h>

type gearman_job_st

void gearman_job_free(gearman_job_st *job)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_data(gearman_job_st *job, const void *data, size_t <#c
.size_t> data_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_warning(gearman_job_st *job, const void *warning,
size_t <#c.size_t> warning_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_status(gearman_job_st *job, uint32_t <#c.uint32_t>
numerator, uint32_t <#c.uint32_t> denominator)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_complete(gearman_job_st *job, const void *result,
size_t <#c.size_t> result_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_exception(gearman_job_st *job, const void *exception,
size_t <#c.size_t> exception_size)

gearman_return_t <#c.gearman_return_t>
gearman_job_send_fail(gearman_job_st *job)

const char *gearman_job_handle(const gearman_job_st *job)

const char *gearman_job_function_name(const gearman_job_st *job)

const char *gearman_job_unique(const gearman_job_st *job)

const void *gearman_job_workload(const gearman_job_st *job)

size_t <#c.size_t> gearman_job_workload_size(const gearman_job_st *job)

void *gearman_job_take_workload(gearman_job_st *job, size_t <#c.size_t>
*data_size)

gearman_client_st <#c.gearman_client_st>
*gearman_job_use_client(gearman_job_st *job)

Link with -lgearman πŸ”—


✨ DESCRIPTION ✨

okay so. gearman_job_st objects get passed to worker functions to represent jobs that are being run by gearman_worker_work() <#c.gearman_worker_work>. that's literally their whole thing πŸ’…

  • gearman_job_free() β€” frees a job. 🧹 and listen, you only ever gotta do this if a task was created with a preallocated structure. otherwise don't bother, no cap.
  • gearman_job_handle() β€” returns the job handle (peep gearman_job_handle_t <#c.gearman_job_handle_t> for the whole lore). 🏷️
  • gearman_job_function_name() β€” returns the name of the function that the job was set to execute against. πŸ‘‘
  • gearman_job_unique() β€” returns the unique value that was used for gearman_job_st. πŸ¦‹
  • gearman_job_take_workload β€” returns the gearman_job_st workload. how big is it? you find that out with gearman_job_workload_size(). πŸ“ gearman_job_take_workload() is the same as gearman_job_workload() except for one tiny little thing: the result must be free(3)d by the caller. yes, you. by you. πŸ™ˆ
  • gearman_job_use_client β€” returns a gearman_client_st <#c.gearman_client_st> configured from gearman_job_st. that gearman_client_st can be used to communicate client API commands to the server. πŸ’¬βœ¨
okay this next bit is IMPORTANT bestie: you do not, and should not, call gearman_client_free() <#c.gearman_client_free> on that gearman_client_st. it gets cleaned up when job is cleaned up. hands off, let it live its life 🫢

πŸ’€ RETURN VALUE πŸ’€

a value of gearman_return_t <#c.gearman_return_t> is returned. on success that value will be :c:type::GEARMAN_SUCCESS. use gearman_strerror() <#c.gearman_strerror> to translate this value into a printable string, so you actually know what it's saying to you 😭⭐


🏠 HOME 🏠

wanna find out more info? go check out: <http://gearman.info/> 🌈


πŸ‘€ SEE ALSO πŸ‘€


πŸŽ€ Author πŸŽ€

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

2011-2014, Data Differential, <http://www.datadifferential.com/>


and that's the whole page, periodt πŸ’… this was version 1.1.21+ds, dated Feb 04, 2026 β€” mwah, slay, go write some workers bestie πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from