Gearman Public API Documentation

libgearman-server/constants.h
Go to the documentation of this file.
00001 /* Gearman server and library
00002  * Copyright (C) 2008 Brian Aker, Eric Day
00003  * All rights reserved.
00004  *
00005  * Use and distribution licensed under the BSD license.  See
00006  * the COPYING file in the parent directory for full text.
00007  */
00008 
00014 #ifndef __GEARMAN_SERVER_CONSTANTS_H__
00015 #define __GEARMAN_SERVER_CONSTANTS_H__
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00027 /* Defines. */
00028 #define GEARMAN_DEFAULT_BACKLOG 64
00029 #define GEARMAN_DEFAULT_MAX_QUEUE_SIZE 0
00030 #define GEARMAN_SERVER_CON_ID_SIZE 128
00031 #define GEARMAN_JOB_HASH_SIZE 383
00032 #define GEARMAN_MAX_FREE_SERVER_CON 1000
00033 #define GEARMAN_MAX_FREE_SERVER_PACKET 2000
00034 #define GEARMAN_MAX_FREE_SERVER_JOB 1000
00035 #define GEARMAN_MAX_FREE_SERVER_CLIENT 1000
00036 #define GEARMAN_MAX_FREE_SERVER_WORKER 1000
00037 #define GEARMAN_TEXT_RESPONSE_SIZE 8192
00038 #define GEARMAN_PIPE_BUFFER_SIZE 256
00039 #define GEARMAN_CONF_MAX_OPTION_SHORT 128
00040 #define GEARMAN_CONF_DISPLAY_WIDTH 80
00041 
00048 typedef enum
00049 {
00050   GEARMAND_WAKEUP_PAUSE,
00051   GEARMAND_WAKEUP_SHUTDOWN,
00052   GEARMAND_WAKEUP_SHUTDOWN_GRACEFUL,
00053   GEARMAND_WAKEUP_CON,
00054   GEARMAND_WAKEUP_RUN
00055 } gearmand_wakeup_t;
00056 
00057 
00064 /* Types. */
00065 typedef struct gearman_server_st gearman_server_st;
00066 typedef struct gearman_server_thread_st gearman_server_thread_st;
00067 typedef struct gearman_server_con_st gearman_server_con_st;
00068 typedef struct gearman_server_packet_st gearman_server_packet_st;
00069 typedef struct gearman_server_function_st gearman_server_function_st;
00070 typedef struct gearman_server_client_st gearman_server_client_st;
00071 typedef struct gearman_server_worker_st gearman_server_worker_st;
00072 typedef struct gearman_server_job_st gearman_server_job_st;
00073 typedef struct gearmand_st gearmand_st;
00074 typedef struct gearmand_port_st gearmand_port_st;
00075 typedef struct gearmand_con_st gearmand_con_st;
00076 typedef struct gearmand_thread_st gearmand_thread_st;
00077 typedef struct gearman_conf_st gearman_conf_st;
00078 typedef struct gearman_conf_option_st gearman_conf_option_st;
00079 typedef struct gearman_conf_module_st gearman_conf_module_st;
00080 
00081 /* Function types. */
00082 typedef void (gearman_server_thread_run_fn)(gearman_server_thread_st *thread,
00083                                             void *context);
00084 
00085 typedef gearman_return_t (gearman_queue_add_fn)(gearman_server_st *server,
00086                                                 void *context,
00087                                                 const void *unique,
00088                                                 size_t unique_size,
00089                                                 const void *function_name,
00090                                                 size_t function_name_size,
00091                                                 const void *data,
00092                                                 size_t data_size,
00093                                                gearman_job_priority_t priority);
00094 typedef gearman_return_t (gearman_queue_flush_fn)(gearman_server_st *server,
00095                                                   void *context);
00096 typedef gearman_return_t (gearman_queue_done_fn)(gearman_server_st *server,
00097                                                  void *context,
00098                                                  const void *unique,
00099                                                  size_t unique_size,
00100                                                  const void *function_name,
00101                                                  size_t function_name_size);
00102 typedef gearman_return_t (gearman_queue_replay_fn)(gearman_server_st *server,
00103                                                    void *context,
00104                                                    gearman_queue_add_fn *add_fn,
00105                                                    void *add_context);
00106 
00107 typedef gearman_return_t (gearman_connection_add_fn)(gearman_connection_st *con);
00108 
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124 
00125 #endif /* __GEARMAN_SERVER_CONSTANTS_H__ */