Use the following set of functions to multiple run tasks concurrently.
See Main Page for full details.
void gearman_client_task_free_all | ( | gearman_client_st * | client | ) |
Free all tasks for a gearman structure.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
void gearman_client_set_task_context_free_fn | ( | gearman_client_st * | client, | |
gearman_task_context_free_fn * | function | |||
) |
Set function to call when tasks are being cleaned up so applications can clean up the task context.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call to clean up task context. |
gearman_task_st* gearman_client_add_task | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | function_name, | |||
const char * | unique, | |||
const void * | workload, | |||
size_t | workload_size, | |||
gearman_return_t * | ret_ptr | |||
) |
Add a task to be run in parallel.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | task | Caller allocated structure, or NULL to allocate one. |
[in] | context | Application context to associate with the task. |
[in] | function_name | The name of the function to run. |
[in] | unique | Optional unique job identifier, or NULL for a new UUID. |
[in] | workload | The workload to pass to the function when it is run. |
[in] | workload_size | Size of the workload. |
[out] | ret_ptr | Standard gearman return value. |
gearman_task_st* gearman_client_add_task_high | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | function_name, | |||
const char * | unique, | |||
const void * | workload, | |||
size_t | workload_size, | |||
gearman_return_t * | ret_ptr | |||
) |
Add a high priority task to be run in parallel. See gearman_client_add_task() for details.
gearman_task_st* gearman_client_add_task_low | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | function_name, | |||
const char * | unique, | |||
const void * | workload, | |||
size_t | workload_size, | |||
gearman_return_t * | ret_ptr | |||
) |
Add a low priority task to be run in parallel. See gearman_client_add_task() for details.
gearman_task_st* gearman_client_add_task_background | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | function_name, | |||
const char * | unique, | |||
const void * | workload, | |||
size_t | workload_size, | |||
gearman_return_t * | ret_ptr | |||
) |
Add a background task to be run in parallel. See gearman_client_add_task() for details.
gearman_task_st* gearman_client_add_task_high_background | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | function_name, | |||
const char * | unique, | |||
const void * | workload, | |||
size_t | workload_size, | |||
gearman_return_t * | ret_ptr | |||
) |
Add a high priority background task to be run in parallel. See gearman_client_add_task() for details.
gearman_task_st* gearman_client_add_task_low_background | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | function_name, | |||
const char * | unique, | |||
const void * | workload, | |||
size_t | workload_size, | |||
gearman_return_t * | ret_ptr | |||
) |
Add a low priority background task to be run in parallel. See gearman_client_add_task() for details.
gearman_task_st* gearman_client_add_task_status | ( | gearman_client_st * | client, | |
gearman_task_st * | task, | |||
void * | context, | |||
const char * | job_handle, | |||
gearman_return_t * | ret_ptr | |||
) |
Add task to get the status for a backgound task in parallel.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | task | Caller allocated structure, or NULL to allocate one. |
[in] | context | Application context to associate with the task. |
[in] | job_handle | The job handle to get status for. |
[out] | ret_ptr | Standard gearman return value. |
void gearman_client_set_workload_fn | ( | gearman_client_st * | client, | |
gearman_workload_fn * | function | |||
) |
Callback function when workload data needs to be sent for a task.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_created_fn | ( | gearman_client_st * | client, | |
gearman_created_fn * | function | |||
) |
Callback function when a job has been created for a task.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_data_fn | ( | gearman_client_st * | client, | |
gearman_data_fn * | function | |||
) |
Callback function when there is a data packet for a task.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_warning_fn | ( | gearman_client_st * | client, | |
gearman_warning_fn * | function | |||
) |
Callback function when there is a warning packet for a task.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_status_fn | ( | gearman_client_st * | client, | |
gearman_universal_status_fn * | function | |||
) |
Callback function when there is a status packet for a task.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_complete_fn | ( | gearman_client_st * | client, | |
gearman_complete_fn * | function | |||
) |
Callback function when a task is complete.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_exception_fn | ( | gearman_client_st * | client, | |
gearman_exception_fn * | function | |||
) |
Callback function when there is an exception packet for a task.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_set_fail_fn | ( | gearman_client_st * | client, | |
gearman_fail_fn * | function | |||
) |
Callback function when a task has failed.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
[in] | function | Function to call. |
void gearman_client_clear_fn | ( | gearman_client_st * | client | ) |
Clear all task callback functions.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |
gearman_return_t gearman_client_run_tasks | ( | gearman_client_st * | client | ) |
Run tasks that have been added in parallel.
[in] | client | Structure previously initialized with gearman_client_create() or gearman_client_clone(). |