Gearman Developer Documentation

Job Declarations
[Worker Declarations]

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_stgearman_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

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.

Parameters:
[in] A valid gearman_worker_st.
[in] gearman_job_st allocated structure, or NULL to allocate one.
Returns:
On success, a pointer to the (possibly allocated) structure. On failure this will be NULL.

Definition at line 33 of file job.c.

void gearman_job_free ( gearman_job_st job  ) 

Free a job structure.

Parameters:
[in] job Structure previously initialized with gearman_worker_grab_job().

Definition at line 731 of file worker.c.

gearman_return_t gearman_job_send_data ( gearman_job_st job,
const void *  data,
size_t  data_size 
)

Send data for a running job.

Definition at line 71 of file job.c.

gearman_return_t gearman_job_send_warning ( gearman_job_st job,
const void *  warning,
size_t  warning_size 
)

Send warning for a running job.

Definition at line 97 of file job.c.

gearman_return_t gearman_job_send_status ( gearman_job_st job,
uint32_t  numerator,
uint32_t  denominator 
)

Send status information for a running job.

Definition at line 124 of file job.c.

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.

Definition at line 158 of file job.c.

gearman_return_t gearman_job_send_exception ( gearman_job_st job,
const void *  exception,
size_t  exception_size 
)

Send exception for a running job.

Definition at line 194 of file job.c.

gearman_return_t gearman_job_send_fail ( gearman_job_st job  ) 

Send fail status for a job.

Definition at line 221 of file job.c.

const char* gearman_job_handle ( const gearman_job_st job  ) 

Get job handle.

Definition at line 252 of file job.c.

const char* gearman_job_function_name ( const gearman_job_st job  ) 

Get the function name associated with a job.

Definition at line 257 of file job.c.

const char* gearman_job_unique ( const gearman_job_st job  ) 

Get the unique ID associated with a job.

Definition at line 262 of file job.c.

const void* gearman_job_workload ( const gearman_job_st job  ) 

Get a pointer to the workload for a job.

Definition at line 269 of file job.c.

size_t gearman_job_workload_size ( const gearman_job_st job  ) 

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.

Generated on Mon Jun 14 15:58:45 2010 by  doxygen 1.6.3