Detailed Description
This is the interface gearman servers should use for creating threads.
Function Documentation
Initialize a thread structure. This cannot fail if the caller supplies a thread structure.
- Parameters:
-
| server | Server structure previously initialized with gearman_server_create. |
| thread | Caller allocated thread structure, or NULL to allocate one. |
- Returns:
- Pointer to an allocated thread structure if thread parameter was NULL, or the thread parameter pointer if it was not NULL.
Definition at line 63 of file thread.c.
Free resources used by a thread structure.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
Definition at line 126 of file thread.c.
Return an error string for the last error encountered.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
- Returns:
- Pointer to static buffer in library that holds an error string.
Definition at line 161 of file thread.c.
Value of errno in the case of a GEARMAN_ERRNO return value.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
- Returns:
- An errno value as defined in your system errno.h file.
Definition at line 166 of file thread.c.
Set custom I/O event watch callback.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
| event_watch | Function to be called when events need to be watched. |
| event_watch_arg | Argument to pass along to event_watch. |
Definition at line 171 of file thread.c.
Set logging callback for server thread instance.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
| function | Function to call when there is a logging message. |
| context | Argument to pass into the log callback function. |
| verbose | Verbosity level. |
Definition at line 186 of file thread.c.
Set thread run callback.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
| run_fn | Function to call when thread should be run. |
| run_arg | Argument to pass along with run_fn. |
Definition at line 178 of file thread.c.
Process server thread connections.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
| ret_ptr | Pointer to hold a standard gearman return value. |
- Returns:
- On error, the server connection that encountered the error.
Definition at line 197 of file thread.c.