Data Structures |
struct | gearman_server_st |
Modules |
| Constants |
| Types |
| Protocol Plugins |
| Queue Plugins |
| Client Declarations |
| Configuration Declarations |
| Configuration Module Declarations |
| Function Declarations |
| Job Declarations |
| Packet Declarations |
| Thread Declarations |
| Worker Declarations |
Functions |
gearman_server_st * | gearman_server_create (gearman_server_st *server) |
void | gearman_server_free (gearman_server_st *server) |
void | gearman_server_set_job_retries (gearman_server_st *server, uint8_t job_retries) |
void | gearman_server_set_worker_wakeup (gearman_server_st *server, uint8_t worker_wakeup) |
void | gearman_server_set_log_fn (gearman_server_st *server, gearman_log_fn *function, void *context, gearman_verbose_t verbose) |
gearman_return_t | gearman_server_run_command (gearman_server_con_st *server_con, gearman_packet_st *packet) |
gearman_return_t | gearman_server_shutdown_graceful (gearman_server_st *server) |
gearman_return_t | gearman_server_queue_replay (gearman_server_st *server) |
void * | gearman_server_queue_context (const gearman_server_st *server) |
void | gearman_server_set_queue_context (gearman_server_st *server, void *context) |
void | gearman_server_set_queue_add_fn (gearman_server_st *server, gearman_queue_add_fn *function) |
void | gearman_server_set_queue_flush_fn (gearman_server_st *server, gearman_queue_flush_fn *function) |
void | gearman_server_set_queue_done_fn (gearman_server_st *server, gearman_queue_done_fn *function) |
void | gearman_server_set_queue_replay_fn (gearman_server_st *server, gearman_queue_replay_fn *function) |
Detailed Description
This is the interface gearman servers should use.
Function Documentation
Initialize a server structure. This cannot fail if the caller supplies a server structure.
- Parameters:
-
server | Caller allocated server structure, or NULL to allocate one. |
- Returns:
- Pointer to an allocated server structure if server parameter was NULL, or the server parameter pointer if it was not NULL.
Free resources used by a server structure.
- Parameters:
-
server | Server structure previously initialized with gearman_server_create. |
void gearman_server_set_job_retries |
( |
gearman_server_st * |
server, |
|
|
uint8_t |
job_retries |
|
) |
| |
Set maximum job retry count.
- Parameters:
-
server | Server structure previously initialized with gearman_server_create. |
job_retries | Number of job attempts. |
void gearman_server_set_worker_wakeup |
( |
gearman_server_st * |
server, |
|
|
uint8_t |
worker_wakeup |
|
) |
| |
Set maximum number of workers to wake up per job.
- Parameters:
-
server | Server structure previously initialized with gearman_server_create. |
worker_wakeup | Number of workers to wake up. |
Set logging callback for server instance.
- Parameters:
-
server | Server structure previously initialized with gearman_server_create. |
function | Function to call when there is a logging message. |
context | Argument to pass into the log callback function. |
verbose | Verbosity level. |
Process commands for a connection.
- Parameters:
-
server_con | Server connection that has a packet to process. |
packet | The packet that needs processing. |
- Returns:
- Standard gearman return value.
Tell server that it should enter a graceful shutdown state.
- Parameters:
-
server | Server structure previously initialized with gearman_server_create. |
- Returns:
- Standard gearman return value. This will return GEARMAN_SHUTDOWN if the server is ready to shutdown now.
Replay the persistent queue to load all unfinshed jobs into the server. This should only be run at startup.
- Parameters:
-
server | Server structure previously initialized with gearman_server_create. |
- Returns:
- Standard gearman return value. This will return GEARMAN_SHUTDOWN if the server is ready to shutdown now.
Get persistent queue context.
Set persistent queue context that will be passed back to all queue callback functions.
Set function to call when jobs need to be stored in the persistent queue.
Set function to call when the persistent queue should be flushed to disk.
Set function to call when a job should be removed from the persistent queue.
Set function to call when jobs in the persistent queue should be replayed after a restart.