Data Structures |
struct | gearman_client_st |
Modules |
| Constants |
| Types |
| Single Task Interface |
| Concurrent Task Interface |
| Task Declarations |
| Static Client Declarations |
Enumerations |
enum | gearman_client_options_t {
GEARMAN_CLIENT_ALLOCATED = (1 << 0),
GEARMAN_CLIENT_NON_BLOCKING = (1 << 1),
GEARMAN_CLIENT_TASK_IN_USE = (1 << 2),
GEARMAN_CLIENT_UNBUFFERED_RESULT = (1 << 3),
GEARMAN_CLIENT_NO_NEW = (1 << 4),
GEARMAN_CLIENT_FREE_TASKS = (1 << 5),
GEARMAN_CLIENT_MAX = (1 << 6)
} |
Functions |
gearman_client_st * | gearman_client_create (gearman_client_st *client) |
gearman_client_st * | gearman_client_clone (gearman_client_st *client, const gearman_client_st *from) |
void | gearman_client_free (gearman_client_st *client) |
const char * | gearman_client_error (const gearman_client_st *client) |
int | gearman_client_errno (const gearman_client_st *client) |
gearman_client_options_t | gearman_client_options (const gearman_client_st *client) |
void | gearman_client_set_options (gearman_client_st *client, gearman_client_options_t options) |
void | gearman_client_add_options (gearman_client_st *client, gearman_client_options_t options) |
void | gearman_client_remove_options (gearman_client_st *client, gearman_client_options_t options) |
int | gearman_client_timeout (gearman_client_st *client) |
void | gearman_client_set_timeout (gearman_client_st *client, int timeout) |
void * | gearman_client_context (const gearman_client_st *client) |
void | gearman_client_set_context (gearman_client_st *client, void *context) |
void | gearman_client_set_log_fn (gearman_client_st *client, gearman_log_fn *function, void *context, gearman_verbose_t verbose) |
void | gearman_client_set_workload_malloc_fn (gearman_client_st *client, gearman_malloc_fn *function, void *context) |
void | gearman_client_set_workload_free_fn (gearman_client_st *client, gearman_free_fn *function, void *context) |
gearman_return_t | gearman_client_add_server (gearman_client_st *client, const char *host, in_port_t port) |
gearman_return_t | gearman_client_add_servers (gearman_client_st *client, const char *servers) |
void | gearman_client_remove_servers (gearman_client_st *client) |
gearman_return_t | gearman_client_wait (gearman_client_st *client) |
Detailed Description
This is the interface gearman clients should use. You can run tasks one at a time or concurrently.
See Main Page for full details.
Enumeration Type Documentation
Options for gearman_client_st.
- Enumerator:
GEARMAN_CLIENT_ALLOCATED |
|
GEARMAN_CLIENT_NON_BLOCKING |
|
GEARMAN_CLIENT_TASK_IN_USE |
|
GEARMAN_CLIENT_UNBUFFERED_RESULT |
|
GEARMAN_CLIENT_NO_NEW |
|
GEARMAN_CLIENT_FREE_TASKS |
|
GEARMAN_CLIENT_MAX |
|
Definition at line 207 of file constants.h.
Function Documentation
Initialize a client 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] | client | Caller 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 97 of file client.c.
Clone a client structure.
- Parameters:
-
[in] | client | Caller allocated structure, or NULL to allocate one. |
[in] | from | Structure to use as a source to clone from. |
- Returns:
- Same return as gearman_client_create().
Definition at line 102 of file client.c.
Free resources used by a client structure.
- Parameters:
-
Definition at line 135 of file client.c.
See gearman_error() for details.
Definition at line 148 of file client.c.
See gearman_errno() for details.
Definition at line 153 of file client.c.
Get options for a client structure.
- Parameters:
-
- Returns:
- Options set for the client structure.
Definition at line 158 of file client.c.
Set options for a client structure.
- Parameters:
-
Definition at line 179 of file client.c.
Add options for a client structure.
- Parameters:
-
Definition at line 205 of file client.c.
Remove options for a client structure.
- Parameters:
-
Definition at line 225 of file client.c.
Get the application context for a client.
- Parameters:
-
- Returns:
- Application context that was previously set, or NULL.
Definition at line 255 of file client.c.
Set the application context for a client.
- Parameters:
-
Definition at line 260 of file client.c.
Add a job server to a client. This goes into a list of servers that can be used to run tasks. No socket I/O happens here, it is just added to a list.
- Parameters:
-
- Returns:
- Standard gearman return value.
Definition at line 286 of file client.c.
Add a list of job servers to a client. The format for the server list is: SERVER[:PORT][,SERVER[:PORT]]... Some examples are: 10.0.0.1,10.0.0.2,10.0.0.3 localhost LIBGEARMAN_BITFIELD234,jobserver2.domain.com:7003,10.0.0.3
- Parameters:
-
- Returns:
- Standard gearman return value.
Definition at line 295 of file client.c.
Remove all servers currently associated with the client.
- Parameters:
-
Definition at line 301 of file client.c.
When in non-blocking I/O mode, wait for activity from one of the servers.
- Parameters:
-
- Returns:
- Standard gearman return value.
Definition at line 306 of file client.c.