GEARMAN_JOB_SEND_WARNING(3)
π GEARMAN_JOB_SEND_WARNING β no cap, the bestie guide to gearman_job_st
okay so this page lives in the Gearmand manual (that's the GEARMAN_JOB_SEND_WARNING(3) situation), and honestly? it's a whole vibe. it's about the little job object your worker gets handed and everything you can do with it. let's get into it π«Ά
β¨ 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)
and when you link, you link with -lgearman. that's it, that's the whole ticket π
πΈ DESCRIPTION πΈ
so, gearman_job_st? these cuties get passed to your worker functions to represent the jobs that are actively being run by gearman_worker_work(). main character job objects, literally.
gearman_job_free()β frees a job. and bestie, listen: you only need to do this if a task was created with a preallocated structure. otherwise don't be out here freeing things that aren't yours to free, it's giving chaos energy πgearman_job_handle()β returns the job handle. (peepgearman_job_handle_tif you want the full lore on that one π)gearman_job_function_name()β returns the name of the function that the job was set to execute against. so like, which function this job signed up to run.gearman_job_unique()β returns the unique value that was used for thegearman_job_st. the β¨uniquenessβ¨, if you will.gearman_job_take_workloadβ returns thegearman_job_stworkload. and the size of it? you figure that out withgearman_job_workload_size().gearman_job_take_workload()is the same asgearman_job_workload()except β and this part MATTERS β the result must befree(3)d by the caller. not me, not the library. you. the caller. okay?? πgearman_job_use_clientβ returns agearman_client_stconfigured from thegearman_job_st. that client can be used to communicate client API commands to the server, which is lowkey iconic of it.
π¨ okay important, no skipping: you do not, and should not, callgearman_client_free()on thatgearman_client_st. it gets cleaned up when the job is cleaned up. mind your business about it and it'll mind its own π
β RETURN VALUE β
a value of gearman_return_t comes back to you. on success, that value will be GEARMAN_SUCCESS β the slay outcome β¨. and if you wanna translate any of these values into a printable string, hit up gearman_strerror(). she'll tell you what's up.
π¦ HOME π¦
want more? go check: <http://gearman.info/> β it's the mothership, fr fr.
π SEE ALSO π
π Author π
Data Differential http://www.datadifferential.com/
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/
okay that's the whole page bestie, you ate π
and for the record, this whole thing is from 1.1.21+ds, dated Feb 04, 2026. take care of your jobs and your jobs will take care of you π«Άπβ
π¦ 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