There is no locking within a single gearman_st structure, so for threaded applications you must either ensure isolation in the application or use multiple gearman_st structures (for example, one for each thread).
| enum gearman_options_t |
Options for gearman_st.
Definition at line 128 of file constants.h.
| const char* gearman_version | ( | void | ) |
Get Gearman library version.
| const char* gearman_bugreport | ( | void | ) |
Get bug report URL.
| const char* gearman_verbose_name | ( | gearman_verbose_t | verbose | ) |
Get string with the name of the given verbose level.
| [in] | verbose | Verbose logging level. |
| gearman_st* gearman_create | ( | gearman_st * | gearman | ) |
Initialize a gearman structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed.
| [in] | gearman | Caller allocated structure, or NULL to allocate one. |
| gearman_st* gearman_clone | ( | gearman_st * | gearman, | |
| const gearman_st * | from | |||
| ) |
Clone a gearman structure.
| [in] | gearman | Caller allocated structure, or NULL to allocate one. |
| [in] | from | Structure to use as a source to clone from. |
| void gearman_free | ( | gearman_st * | gearman | ) |
Free a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| const char* gearman_error | ( | const gearman_st * | gearman | ) |
Return an error string for last error encountered.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| int gearman_errno | ( | const gearman_st * | gearman | ) |
Value of errno in the case of a GEARMAN_ERRNO return value.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| gearman_options_t gearman_options | ( | const gearman_st * | gearman | ) |
Get options for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| void gearman_set_options | ( | gearman_st * | gearman, | |
| gearman_options_t | options | |||
| ) |
Set options for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | options | Available options for gearman structures. |
| void gearman_add_options | ( | gearman_st * | gearman, | |
| gearman_options_t | options | |||
| ) |
Add options for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | options | Available options for gearman structures. |
| void gearman_remove_options | ( | gearman_st * | gearman, | |
| gearman_options_t | options | |||
| ) |
Remove options for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | options | Available options for gearman structures. |
| int gearman_timeout | ( | gearman_st * | gearman | ) |
Get current socket I/O activity timeout value.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| void gearman_set_timeout | ( | gearman_st * | gearman, | |
| int | timeout | |||
| ) |
Set socket I/O activity timeout for connections in a Gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | timeout | Milliseconds to wait for I/O activity. A negative value means an infinite timeout. |
| void gearman_set_log_fn | ( | gearman_st * | gearman, | |
| gearman_log_fn * | function, | |||
| const void * | context, | |||
| gearman_verbose_t | verbose | |||
| ) |
Set logging function for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | function | Function to call when there is a logging message. |
| [in] | context | Argument to pass into the callback function. |
| [in] | verbose | Verbosity level threshold. Only call function when the logging message is equal to or less verbose that this. |
| void gearman_set_event_watch_fn | ( | gearman_st * | gearman, | |
| gearman_event_watch_fn * | function, | |||
| const void * | context | |||
| ) |
Set custom I/O event callback function for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | function | Function to call when there is an I/O event. |
| [in] | context | Argument to pass into the callback function. |
| void gearman_set_workload_malloc_fn | ( | gearman_st * | gearman, | |
| gearman_malloc_fn * | function, | |||
| const void * | context | |||
| ) |
Set custom memory allocation function for workloads. Normally gearman uses the standard system malloc to allocate memory used with workloads. The provided function will be used instead.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | function | Memory allocation function to use instead of malloc(). |
| [in] | context | Argument to pass into the callback function. |
| void gearman_set_workload_free_fn | ( | gearman_st * | gearman, | |
| gearman_free_fn * | function, | |||
| const void * | context | |||
| ) |
Set custom memory free function for workloads. Normally gearman uses the standard system free to free memory used with workloads. The provided function will be used instead.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | function | Memory free function to use instead of free(). |
| [in] | context | Argument to pass into the callback function. |
| gearman_con_st* gearman_con_create | ( | gearman_st * | gearman, | |
| gearman_con_st * | con | |||
| ) |
Initialize a connection structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | con | Caller allocated structure, or NULL to allocate one. |
| gearman_con_st* gearman_con_add | ( | gearman_st * | gearman, | |
| gearman_con_st * | con, | |||
| const char * | host, | |||
| in_port_t | port | |||
| ) |
Create a connection structure with the given host and port.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | con | Caller allocated structure, or NULL to allocate one. |
| [in] | host | Host or IP address to connect to. |
| [in] | port | Port to connect to. |
| gearman_con_st* gearman_con_clone | ( | gearman_st * | gearman, | |
| gearman_con_st * | con, | |||
| const gearman_con_st * | from | |||
| ) |
Clone a connection structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | con | Caller allocated structure, or NULL to allocate one. |
| [in] | from | Structure to use as a source to clone from. |
| void gearman_con_free | ( | gearman_con_st * | con | ) |
Free a connection structure.
| [in] | con | Structure previously initialized with gearman_con_create(), gearman_con_add(), or gearman_con_clone(). |
| void gearman_con_free_all | ( | gearman_st * | gearman | ) |
Free all connections for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| gearman_return_t gearman_con_flush_all | ( | gearman_st * | gearman | ) |
Flush the send buffer for all connections.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| gearman_return_t gearman_con_send_all | ( | gearman_st * | gearman, | |
| const gearman_packet_st * | packet | |||
| ) |
Send packet to all connections.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | packet | Initialized packet to send to all connections. |
| gearman_return_t gearman_con_wait | ( | gearman_st * | gearman | ) |
Wait for I/O on connections.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| gearman_con_st* gearman_con_ready | ( | gearman_st * | gearman | ) |
Get next connection that is ready for I/O.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| gearman_return_t gearman_con_echo | ( | gearman_st * | gearman, | |
| const void * | workload, | |||
| size_t | workload_size | |||
| ) |
Test echo with all connections.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | workload | Data to send in echo packet. |
| [in] | workload_size | Size of workload. |
| gearman_packet_st* gearman_packet_create | ( | gearman_st * | gearman, | |
| gearman_packet_st * | packet | |||
| ) |
Initialize a packet structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | packet | Caller allocated structure, or NULL to allocate one. |
| gearman_return_t gearman_packet_add | ( | gearman_st * | gearman, | |
| gearman_packet_st * | packet, | |||
| gearman_magic_t | magic, | |||
| gearman_command_t | command, | |||
| const void * | arg, | |||
| ... | ||||
| ) |
Initialize a packet with all arguments. Variable list is NULL terminated alternating argument and argument size (size_t) pairs. For example:
ret= gearman_packet_add_args(gearman, packet,
GEARMAN_MAGIC_REQUEST,
GEARMAN_COMMAND_SUBMIT_JOB,
function_name, strlen(function_name) + 1,
unique_string, strlen(unique_string) + 1,
workload, workload_size, NULL);
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
| [in] | packet | Pre-allocated packet to initialize with arguments. |
| [in] | magic | Magic type for packet header. |
| [in] | command | Command type for packet. |
| [in] | arg | NULL terminated argument list in pairs of "arg, arg_size". |
| void gearman_packet_free | ( | gearman_packet_st * | packet | ) |
Free a packet structure.
| [in] | packet | Structure previously initialized with gearman_packet_create() or gearman_packet_add(). |
| void gearman_packet_free_all | ( | gearman_st * | gearman | ) |
Free all packets for a gearman structure.
| [in] | gearman | Structure previously initialized with gearman_create() or gearman_clone(). |
1.5.6