4 #include "../acl_cpp_define.hpp" 5 #include "../stdlib/string.hpp" 6 #include "../stdlib/noncopyable.hpp" 7 #include "../stream/socket_stream.hpp" 9 #if !defined(ACL_CLIENT_ONLY) && !defined(ACL_BEANSTALK_DISABLE) 42 beanstalk(
const char* addr,
int conn_timeout,
bool retry =
true);
53 bool use(
const char* tube);
66 unsigned long long put(
const void* data,
size_t len,
67 unsigned pri = 1024,
unsigned delay = 0,
unsigned ttr = 60);
79 unsigned long long format_put(
unsigned pri,
unsigned delay,
unsigned ttr,
82 unsigned long long vformat_put(
const char*
fmt, va_list ap,
83 unsigned pri = 1024,
unsigned delay = 0,
unsigned ttr = 60);
104 unsigned watch(
const char* tube);
113 unsigned ignore(
const char* tube);
121 unsigned ignore_all();
136 unsigned long long reserve(
string& buf,
int timeout = -1);
143 bool delete_id(
unsigned long long id);
153 bool release(
unsigned long long id,
unsigned pri = 1024,
163 bool bury(
unsigned long long id,
unsigned pri = 1024);
173 bool touch(
unsigned long long id);
203 unsigned long long peek(
string& buf,
unsigned long long id);
212 unsigned long long peek_ready(
string& buf);
221 unsigned long long peek_delayed(
string& buf);
230 unsigned long long peek_buried(
string& buf);
239 int kick(
unsigned n);
246 bool list_tube_used(
string&buf);
253 bool list_tubes(
string& buf);
260 bool list_tubes_watched(
string& buf);
268 bool pause_tube(
const char* tube,
unsigned delay);
274 return errbuf_.c_str();
297 std::vector<char*> tubes_watched_;
299 unsigned long long peek_fmt(
string& buf,
const char*
fmt, ...)
301 bool list_tubes_fmt(
string& buf, const
char*
fmt, ...)
304 unsigned ignore_one(const
char* tube);
305 bool beanstalk_open();
306 bool beanstalk_use();
307 unsigned beanstalk_watch(const
char* tube);
308 ACL_ARGV* beanstalk_request(const
string& cmdline,
309 const
void* data = NULL,
size_t len = 0);
314 #endif // !defined(ACL_CLIENT_ONLY) && !defined(ACL_BEANSTALK_DISABLE) #define ACL_CPP_PRINTF(format_idx, arg_idx)
const char * get_addr() const
socket_stream & get_conn()
const char * get_error() const
ACL_API void const char * fmt