Server Thread Handling
Detailed Description
This is the interface gearman servers should use for creating threads.
Enumeration Type Documentation
Options for gearman_server_thread_st.
- Enumerator:
GEARMAN_SERVER_THREAD_ALLOCATED |
|
Definition at line 75 of file constants.h.
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.
Free resources used by a thread structure.
- Parameters:
-
| thread | Thread structure previously initialized with gearman_server_thread_create. |
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.
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.
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. |
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. |
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. |
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.