51
51
#define GEARMAN_TEXT_RESPONSE_SIZE 8192
52
52
#define GEARMAN_WORKER_WAIT_TIMEOUT (10 * 1000) /* Milliseconds */
53
53
#define GEARMAN_PIPE_BUFFER_SIZE 256
54
#define GEARMAN_CONF_MAX_OPTION_SHORT 128
55
#define GEARMAN_CONF_DISPLAY_WIDTH 80
56
58
typedef struct gearman_st gearman_st;
71
73
typedef struct gearman_server_worker_st gearman_server_worker_st;
72
74
typedef struct gearman_server_job_st gearman_server_job_st;
73
75
typedef struct gearmand_st gearmand_st;
76
typedef struct gearmand_port_st gearmand_port_st;
74
77
typedef struct gearmand_con_st gearmand_con_st;
75
78
typedef struct gearmand_thread_st gearmand_thread_st;
79
typedef struct gearman_conf_st gearman_conf_st;
80
typedef struct gearman_conf_option_st gearman_conf_option_st;
81
typedef struct gearman_conf_module_st gearman_conf_module_st;
158
GEARMAN_CON_ALLOCATED= (1 << 0),
159
GEARMAN_CON_READY= (1 << 1),
160
GEARMAN_CON_PACKET_IN_USE= (1 << 2),
161
GEARMAN_CON_EXTERNAL_FD= (1 << 3)
169
GEARMAN_CON_ALLOCATED= (1 << 0),
170
GEARMAN_CON_READY= (1 << 1),
171
GEARMAN_CON_PACKET_IN_USE= (1 << 2),
172
GEARMAN_CON_EXTERNAL_FD= (1 << 3),
173
GEARMAN_CON_IGNORE_LOST_CONNECTION= (1 << 4),
174
GEARMAN_CON_CLOSE_AFTER_FLUSH= (1 << 5)
162
175
} gearman_con_options_t;
330
343
GEARMAN_CLIENT_NON_BLOCKING= (1 << 1),
331
344
GEARMAN_CLIENT_TASK_IN_USE= (1 << 2),
332
345
GEARMAN_CLIENT_UNBUFFERED_RESULT= (1 << 3),
333
GEARMAN_CLIENT_NO_NEW= (1 << 4)
346
GEARMAN_CLIENT_NO_NEW= (1 << 4),
347
GEARMAN_CLIENT_FREE_TASKS= (1 << 5)
334
348
} gearman_client_options_t;
501
515
} gearmand_thread_options_t;
518
* @ingroup gearman_conf
519
* Options for gearman_conf_st.
523
GEARMAN_CONF_ALLOCATED= (1 << 0)
524
} gearman_conf_options_t;
527
* @ingroup gearman_conf_module
528
* Options for gearman_conf_module_st.
532
GEARMAN_CONF_MODULE_ALLOCATED= (1 << 0)
533
} gearman_conf_module_options_t;
504
537
* @addtogroup gearman_constants Gearman Constants
515
548
typedef gearman_return_t (gearman_exception_fn)(gearman_task_st *task);
516
549
typedef gearman_return_t (gearman_fail_fn)(gearman_task_st *task);
551
typedef gearman_return_t (gearman_parse_server_fn)(const char *host,
552
in_port_t port, void *data);
518
554
typedef void* (gearman_worker_fn)(gearman_job_st *job, void *fn_arg,
519
555
size_t *result_size,
520
556
gearman_return_t *ret_ptr);
541
577
typedef void (gearman_server_thread_run_fn)(gearman_server_thread_st *thread,
580
typedef gearman_return_t (gearman_con_add_fn)(gearman_con_st *con);
582
typedef void (gearman_con_protocol_data_free_fn)(gearman_con_st *con,
585
typedef gearman_packet_st* (gearman_con_recv_fn)(gearman_con_st *con,
586
gearman_packet_st *packet,
587
gearman_return_t *ret_ptr,
589
typedef size_t (gearman_con_recv_data_fn)(gearman_con_st *con, void *data,
591
gearman_return_t *ret_ptr);
593
typedef gearman_return_t (gearman_con_send_fn)(gearman_con_st *con,
594
gearman_packet_st *packet,
596
typedef size_t (gearman_con_send_data_fn)(gearman_con_st *con, const void *data,
598
gearman_return_t *ret_ptr);
600
typedef size_t (gearman_packet_pack_fn)(gearman_packet_st *packet,
602
void *data, size_t data_size,
603
gearman_return_t *ret_ptr);
604
typedef size_t (gearman_packet_unpack_fn)(gearman_packet_st *packet,
605
gearman_con_st *con, const void *data,
607
gearman_return_t *ret_ptr);
544
609
typedef gearman_return_t (gearman_queue_add_fn)(gearman_st *gearman,
546
611
const void *unique,
555
620
typedef gearman_return_t (gearman_queue_done_fn)(gearman_st *gearman,
557
622
const void *unique,
624
const void *function_name,
625
size_t function_name_size);
559
626
typedef gearman_return_t (gearman_queue_replay_fn)(gearman_st *gearman,
561
628
gearman_queue_add_fn *add_fn,