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. (peep gearman_job_handle_t if 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 the gearman_job_st. the ✨uniqueness✨, if you will.
  • gearman_job_take_workload β€” returns the gearman_job_st workload. and the size of it? you figure that out with gearman_job_workload_size(). gearman_job_take_workload() is the same as gearman_job_workload() except β€” and this part MATTERS β€” the result must be free(3)d by the caller. not me, not the library. you. the caller. okay?? 😭
  • gearman_job_use_client β€” returns a gearman_client_st configured from the gearman_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, call gearman_client_free() on that gearman_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/

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