The job functions are used to manage jobs assigned to workers. It is most commonly used with the worker interface.
Priority levels for a job.
GEARMAN_JOB_PRIORITY_HIGH | |
GEARMAN_JOB_PRIORITY_NORMAL | |
GEARMAN_JOB_PRIORITY_LOW | |
GEARMAN_JOB_PRIORITY_MAX |
Definition at line 195 of file constants.h.
GEARMAN_LOCAL gearman_job_st* gearman_job_create | ( | gearman_worker_st * | worker, | |
gearman_job_st * | job | |||
) |
Initialize a job structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed. It is not required to memset() a structure before providing it.
[in] | A | valid gearman_worker_st. |
[in] | gearman_job_st | allocated structure, or NULL to allocate one. |
void gearman_job_free | ( | gearman_job_st * | job | ) |
Free a job structure.
[in] | job | Structure previously initialized with gearman_worker_grab_job(). |
gearman_return_t gearman_job_send_data | ( | gearman_job_st * | job, | |
const void * | data, | |||
size_t | data_size | |||
) |
Send data for a running job.
gearman_return_t gearman_job_send_warning | ( | gearman_job_st * | job, | |
const void * | warning, | |||
size_t | warning_size | |||
) |
Send warning for a running job.
gearman_return_t gearman_job_send_status | ( | gearman_job_st * | job, | |
uint32_t | numerator, | |||
uint32_t | denominator | |||
) |
Send status information for a running job.
gearman_return_t gearman_job_send_complete | ( | gearman_job_st * | job, | |
const void * | result, | |||
size_t | result_size | |||
) |
Send result and complete status for a job.
gearman_return_t gearman_job_send_exception | ( | gearman_job_st * | job, | |
const void * | exception, | |||
size_t | exception_size | |||
) |
Send exception for a running job.
gearman_return_t gearman_job_send_fail | ( | gearman_job_st * | job | ) |
Send fail status for a job.
const char* gearman_job_handle | ( | const gearman_job_st * | job | ) |
Get job handle.
const char* gearman_job_function_name | ( | const gearman_job_st * | job | ) |
Get the function name associated with a job.
const char* gearman_job_unique | ( | const gearman_job_st * | job | ) |
Get the unique ID associated with a job.
const void* gearman_job_workload | ( | const gearman_job_st * | job | ) |
Get a pointer to the workload for a job.
size_t gearman_job_workload_size | ( | const gearman_job_st * | job | ) |
Get size of the workload for a job.
void* gearman_job_take_workload | ( | gearman_job_st * | job, | |
size_t * | data_size | |||
) |
Take allocated workload from job. After this, the caller is responsible for free()ing the memory.