Gearman Developer Documentation

Task Management
[Client Interface]

Data Structures

struct  gearman_task_st

Enumerations

enum  gearman_task_options_t { GEARMAN_TASK_ALLOCATED = (1 << 0), GEARMAN_TASK_SEND_IN_USE = (1 << 1) }
enum  gearman_task_state_t {
  GEARMAN_TASK_STATE_NEW, GEARMAN_TASK_STATE_SUBMIT, GEARMAN_TASK_STATE_WORKLOAD, GEARMAN_TASK_STATE_WORK,
  GEARMAN_TASK_STATE_CREATED, GEARMAN_TASK_STATE_DATA, GEARMAN_TASK_STATE_WARNING, GEARMAN_TASK_STATE_STATUS,
  GEARMAN_TASK_STATE_COMPLETE, GEARMAN_TASK_STATE_EXCEPTION, GEARMAN_TASK_STATE_FAIL, GEARMAN_TASK_STATE_FINISHED
}

Functions

void * gearman_task_context (const gearman_task_st *task)
void gearman_task_set_context (gearman_task_st *task, const void *context)
const char * gearman_task_function_name (const gearman_task_st *task)
const char * gearman_task_unique (const gearman_task_st *task)
const char * gearman_task_job_handle (const gearman_task_st *task)
bool gearman_task_is_known (const gearman_task_st *task)
bool gearman_task_is_running (const gearman_task_st *task)
uint32_t gearman_task_numerator (const gearman_task_st *task)
uint32_t gearman_task_denominator (const gearman_task_st *task)
void gearman_task_give_workload (gearman_task_st *task, const void *workload, size_t workload_size)
size_t gearman_task_send_workload (gearman_task_st *task, const void *workload, size_t workload_size, gearman_return_t *ret_ptr)
const void * gearman_task_data (const gearman_task_st *task)
size_t gearman_task_data_size (const gearman_task_st *task)
void * gearman_task_take_data (gearman_task_st *task, size_t *data_size)
size_t gearman_task_recv_data (gearman_task_st *task, void *data, size_t data_size, gearman_return_t *ret_ptr)

Detailed Description

The task functions are used to manage tasks being run by clients. They are most commonly used with the client interface.


Enumeration Type Documentation

Options for gearman_task_st.

Enumerator:
GEARMAN_TASK_ALLOCATED 
GEARMAN_TASK_SEND_IN_USE 

Definition at line 258 of file constants.h.

States for gearman_task_st.

Enumerator:
GEARMAN_TASK_STATE_NEW 
GEARMAN_TASK_STATE_SUBMIT 
GEARMAN_TASK_STATE_WORKLOAD 
GEARMAN_TASK_STATE_WORK 
GEARMAN_TASK_STATE_CREATED 
GEARMAN_TASK_STATE_DATA 
GEARMAN_TASK_STATE_WARNING 
GEARMAN_TASK_STATE_STATUS 
GEARMAN_TASK_STATE_COMPLETE 
GEARMAN_TASK_STATE_EXCEPTION 
GEARMAN_TASK_STATE_FAIL 
GEARMAN_TASK_STATE_FINISHED 

Definition at line 268 of file constants.h.


Function Documentation

void* gearman_task_context ( const gearman_task_st task  ) 

Get context for a task.

Definition at line 20 of file task.c.

void gearman_task_set_context ( gearman_task_st task,
const void *  context 
)

Set context for a task.

Definition at line 25 of file task.c.

const char* gearman_task_function_name ( const gearman_task_st task  ) 

Get function name associated with a task.

Definition at line 30 of file task.c.

const char* gearman_task_unique ( const gearman_task_st task  ) 

Get unique identifier for a task.

Definition at line 35 of file task.c.

const char* gearman_task_job_handle ( const gearman_task_st task  ) 

Get job handle for a task.

Definition at line 40 of file task.c.

bool gearman_task_is_known ( const gearman_task_st task  ) 

Get status on whether a task is known or not.

Definition at line 45 of file task.c.

bool gearman_task_is_running ( const gearman_task_st task  ) 

Get status on whether a task is running or not.

Definition at line 50 of file task.c.

uint32_t gearman_task_numerator ( const gearman_task_st task  ) 

Get the numerator of percentage complete for a task.

Definition at line 55 of file task.c.

uint32_t gearman_task_denominator ( const gearman_task_st task  ) 

Get the denominator of percentage complete for a task.

Definition at line 60 of file task.c.

void gearman_task_give_workload ( gearman_task_st task,
const void *  workload,
size_t  workload_size 
)

Give allocated memory to task. After this, the library will be responsible for freeing the workload memory when the task is destroyed.

Definition at line 65 of file task.c.

size_t gearman_task_send_workload ( gearman_task_st task,
const void *  workload,
size_t  workload_size,
gearman_return_t ret_ptr 
)

Send packet workload for a task.

Definition at line 71 of file task.c.

const void* gearman_task_data ( const gearman_task_st task  ) 

Get result data being returned for a task.

Definition at line 78 of file task.c.

size_t gearman_task_data_size ( const gearman_task_st task  ) 

Get result data size being returned for a task.

Definition at line 83 of file task.c.

void* gearman_task_take_data ( gearman_task_st task,
size_t *  data_size 
)

Take allocated result data from task. After this, the caller is responsible for free()ing the memory.

Definition at line 88 of file task.c.

size_t gearman_task_recv_data ( gearman_task_st task,
void *  data,
size_t  data_size,
gearman_return_t ret_ptr 
)

Read result data into a buffer for a task.

Definition at line 93 of file task.c.


Generated on Tue Oct 13 20:19:22 2009 by  doxygen 1.6.1