Data Structures |
struct | gearman_job_st |
Modules |
| Static Job Declarations |
Enumerations |
enum | gearman_job_priority_t { GEARMAN_JOB_PRIORITY_HIGH,
GEARMAN_JOB_PRIORITY_NORMAL,
GEARMAN_JOB_PRIORITY_LOW,
GEARMAN_JOB_PRIORITY_MAX
} |
Functions |
GEARMAN_LOCAL gearman_job_st * | gearman_job_create (gearman_worker_st *worker, gearman_job_st *job) |
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) |
Detailed Description
The job functions are used to manage jobs assigned to workers. It is most commonly used with the worker interface.
Enumeration Type Documentation
Priority levels for a job.
- Enumerator:
GEARMAN_JOB_PRIORITY_HIGH |
|
GEARMAN_JOB_PRIORITY_NORMAL |
|
GEARMAN_JOB_PRIORITY_LOW |
|
GEARMAN_JOB_PRIORITY_MAX |
|
Definition at line 195 of file constants.h.
Function Documentation
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.
- Parameters:
-
- Returns:
- On success, a pointer to the (possibly allocated) structure. On failure this will be NULL.
Definition at line 33 of file job.c.
Free a job structure.
- Parameters:
-
Definition at line 731 of file worker.c.
Send data for a running job.
Definition at line 71 of file job.c.
Send warning for a running job.
Definition at line 97 of file job.c.
Send status information for a running job.
Definition at line 124 of file job.c.
Send result and complete status for a job.
Definition at line 158 of file job.c.
Send exception for a running job.
Definition at line 194 of file job.c.
Send fail status for a job.
Definition at line 221 of file job.c.
Get job handle.
Definition at line 252 of file job.c.
Get the function name associated with a job.
Definition at line 257 of file job.c.
Get the unique ID associated with a job.
Definition at line 262 of file job.c.
Get a pointer to the workload for a job.
Definition at line 269 of file job.c.
Get size of the workload for a job.
Definition at line 274 of file job.c.
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.
Definition at line 279 of file job.c.