Gearman Server Declarations
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 |
| Connection Declarations |
| Private Server Functions |
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.
Definition at line 67 of file server.c.
Free resources used by a server structure.
- Parameters:
-
| server | Server structure previously initialized with gearman_server_create. |
Definition at line 137 of file server.c.
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. |
Definition at line 192 of file server.c.
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. |
Definition at line 198 of file server.c.
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. |
Definition at line 204 of file server.c.
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.
Definition at line 213 of file server.c.
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.
Definition at line 649 of file server.c.
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.
Definition at line 659 of file server.c.
Get persistent queue context.
Definition at line 676 of file server.c.
Set persistent queue context that will be passed back to all queue callback functions.
Definition at line 681 of file server.c.
Set function to call when jobs need to be stored in the persistent queue.
Definition at line 687 of file server.c.
Set function to call when the persistent queue should be flushed to disk.
Definition at line 693 of file server.c.
Set function to call when a job should be removed from the persistent queue.
Definition at line 699 of file server.c.
Set function to call when jobs in the persistent queue should be replayed after a restart.
Definition at line 705 of file server.c.