2019-07-27 22:44:32 +08:00
|
|
|
|
#pragma once
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../acl_cpp_define.hpp"
|
2019-05-09 13:57:51 +08:00
|
|
|
|
#include "../stdlib/noncopyable.hpp"
|
2015-05-06 17:16:10 +08:00
|
|
|
|
|
2019-05-18 21:19:21 +08:00
|
|
|
|
#ifndef ACL_CLIENT_ONLY
|
|
|
|
|
|
2015-05-06 17:16:10 +08:00
|
|
|
|
namespace acl
|
|
|
|
|
{
|
|
|
|
|
|
2015-09-08 17:21:04 +08:00
|
|
|
|
/**
|
2019-07-27 22:44:32 +08:00
|
|
|
|
* 在添加任务时,此类指定的任务的添加条件限定
|
2015-09-08 17:21:04 +08:00
|
|
|
|
*/
|
2019-05-09 13:57:51 +08:00
|
|
|
|
class ACL_CPP_API disque_cond : public noncopyable
|
2015-05-06 17:16:10 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
disque_cond();
|
|
|
|
|
~disque_cond();
|
|
|
|
|
|
|
|
|
|
int get_replicate() const
|
|
|
|
|
{
|
|
|
|
|
return replicate_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int get_delay() const
|
|
|
|
|
{
|
|
|
|
|
return delay_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int get_retry() const
|
|
|
|
|
{
|
|
|
|
|
return retry_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int get_ttl() const
|
|
|
|
|
{
|
|
|
|
|
return ttl_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int get_maxlen() const
|
|
|
|
|
{
|
|
|
|
|
return maxlen_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool is_async() const
|
|
|
|
|
{
|
|
|
|
|
return async_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
disque_cond& set_replicate(int n);
|
|
|
|
|
disque_cond& set_delay(int n);
|
|
|
|
|
disque_cond& set_retry(int n);
|
|
|
|
|
disque_cond& set_ttl(int n);
|
|
|
|
|
disque_cond& set_maxlen(int n);
|
|
|
|
|
disque_cond& set_async(bool on);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int replicate_;
|
|
|
|
|
int delay_;
|
|
|
|
|
int retry_;
|
|
|
|
|
int ttl_;
|
|
|
|
|
int maxlen_;
|
|
|
|
|
bool async_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|
2019-05-18 21:19:21 +08:00
|
|
|
|
|
|
|
|
|
#endif // ACL_CLIENT_ONLY
|