GEARMAN_JOB_TAKE_WORKLOAD(3)
π GEARMAN_JOB_TAKE_WORKLOAD(3) β the Gearmand girlies' guide π
okay bestie, welcome to Gearmand Documentation β¨ this is the page for GEARMAN_JOB_TAKE_WORKLOAD(3), and yeah it's a whole vibe. let's get into it π«Ά
β¨ NAME β¨
gearman_job_take_workload β Gearmand Documentation, http://gearman.info/ π
πΈ SYNOPSIS πΈ
#include <libgearman/gearman.h>
type gearman_job_st
void gearman_job_free(gearman_job_st *job)
gearman_return_t gearman_job_send_data(gearman_job_st *job, const void *data, size_t data_size)
gearman_return_t gearman_job_send_warning(gearman_job_st *job, const void *warning, size_t warning_size)
gearman_return_t gearman_job_send_status(gearman_job_st *job, uint32_t numerator, uint32_t denominator)
gearman_return_t gearman_job_send_complete(gearman_job_st *job, const void *result, size_t result_size)
gearman_return_t gearman_job_send_exception(gearman_job_st *job, const void *exception, size_t exception_size)
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 gearman_job_workload_size(const gearman_job_st *job)
void *gearman_job_take_workload(gearman_job_st *job, size_t *data_size)
gearman_client_st *gearman_job_use_client(gearman_job_st *job)
psst β link with -lgearman or nothing works, and that's not a drill π
π DESCRIPTION π
so like. gearman_job_st is the lil struct that gets handed to worker functions, and it represents, like, the actual jobs that are being run by gearman_worker_work(). main character energy, fr fr π
gearman_job_free() is what you use to free a job. and listen β you only need to do this if a task was created with a preallocated structure. not every job, bestie. read the room β
gearman_job_handle() returns the job handle π (peep gearman_job_handle_t if you want the whole lore on that one).
gearman_job_function_name() returns the name of the function that the job was set to execute against. iconic. it knows its purpose π«
gearman_job_unique() returns the unique value that was used for gearman_job_st π¦
gearman_job_take_workload returns the gearman_job_st workload. you can figure out the size of it with gearman_job_workload_size() π gearman_job_take_workload() is literally the same as gearman_job_workload(), with ONE (1) exception: the result must be free(3)d by the caller. so like, that memory is yours now. take care of it. be responsible. slay but responsibly π
gearman_job_use_client returns a gearman_client_st that's configured from gearman_job_st. that gearman_client_st can be used to communicate client API commands to the server π‘
β οΈ and here's the thing: you do not, and should not, callgearman_client_free()on thatgearman_client_st. it gets cleaned up when the job is cleaned up. so hands off, bestie π do NOT free it. it's not your child, it's the job's child.
π¦ RETURN VALUE π¦
a value of gearman_return_t is returned π on success, that value will be :c:type::GEARMAN_SUCCESS β and if you're staring at it like ????? use gearman_strerror() to translate that value into a printable string. problem solved, no cap π«Ά
π HOME π
wanna find out more? literally just go here: http://gearman.info/ π§ it's giving home base.
π SEE ALSO π
π Author π
Data Differential http://www.datadifferential.com/
π Copyright π
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, brought to you by the Gearmand crew β ily, go write some workers, and remember: free your take_workload, don't free your client. 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