forked from beanstalkd/beanstalkd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
prot.h
41 lines (28 loc) · 841 Bytes
/
prot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* prot.h - protocol implementation header */
#ifndef prot_h
#define prot_h
#include "job.h"
#include "conn.h"
/* space for 16 Mi jobs */
#define HEAP_SIZE 16 * 1024 * 1024
#define URGENT_THRESHOLD 1024
/* measured in seconds */
#define RESERVATION_TIMEOUT 120
#define MSG_RESERVED "RESERVED"
void prot_init();
void reply(conn c, char *line, int len, int state);
void reply_job(conn c, job j, const char *word);
conn remove_waiting_conn(conn c);
void enqueue_waiting_conn(conn c);
int enqueue_job(job j, unsigned int delay);
void bury_job(job j);
int kick_job();
void process_queue();
job peek_job(unsigned long long int id);
job peek_buried_job();
unsigned int get_ready_job_ct();
unsigned int get_delayed_job_ct();
unsigned int get_buried_job_ct();
unsigned int get_urgent_job_ct();
int count_cur_waiting();
#endif /*prot_h*/