Merge branch 'master' of https://github.com/sogou/workflow into nossl

This commit is contained in:
Xie Han
2025-09-08 15:22:46 +08:00
7 changed files with 44 additions and 5 deletions

View File

@@ -69,7 +69,7 @@ static bool parse_list_service_result(const json_value_t *root,
std::vector<struct ConsulServiceTags>& result);
bool WFConsulTask::get_discover_result(
std::vector<struct ConsulServiceInstance>& result)
std::vector<struct ConsulServiceInstance>& result) const
{
json_value_t *root;
int errno_bak;
@@ -97,7 +97,7 @@ bool WFConsulTask::get_discover_result(
}
bool WFConsulTask::get_list_service_result(
std::vector<struct ConsulServiceTags>& result)
std::vector<struct ConsulServiceTags>& result) const
{
json_value_t *root;
int errno_bak;

View File

@@ -43,10 +43,10 @@ class WFConsulTask : public WFGenericTask
{
public:
bool get_discover_result(
std::vector<struct protocol::ConsulServiceInstance>& result);
std::vector<struct protocol::ConsulServiceInstance>& result) const;
bool get_list_service_result(
std::vector<struct protocol::ConsulServiceTags>& result);
std::vector<struct protocol::ConsulServiceTags>& result) const;
public:
void set_service(const struct protocol::ConsulService *service);
@@ -70,6 +70,7 @@ public:
{
this->consul_index = consul_index;
}
long long get_consul_index() const { return this->consul_index; }
const protocol::HttpResponse *get_http_resp() const

View File

@@ -33,6 +33,11 @@ public:
return this->chunk;
}
const protocol::HttpMessageChunk *get_chunk() const
{
return this->chunk;
}
public:
protocol::HttpRequest *get_req()
{
@@ -44,6 +49,16 @@ public:
return this->task->get_resp();
}
const protocol::HttpRequest *get_req() const
{
return this->task->get_req();
}
const protocol::HttpResponse *get_resp() const
{
return this->task->get_resp();
}
public:
void set_watch_timeout(int timeout)
{

View File

@@ -1647,3 +1647,8 @@ KafkaMetaList *WFKafkaClient::get_meta_list()
return &this->member->meta_list;
}
const KafkaMetaList *WFKafkaClient::get_meta_list() const
{
return &this->member->meta_list;
}

View File

@@ -101,6 +101,11 @@ public:
return &this->result;
}
const protocol::KafkaResult *get_result() const
{
return &this->result;
}
int get_kafka_error() const
{
return this->kafka_error;
@@ -170,7 +175,7 @@ public:
public:
protocol::KafkaMetaList *get_meta_list();
protocol::KafkaBrokerList *get_broker_list();
const protocol::KafkaMetaList *get_meta_list() const;
private:
class KafkaMember *member;

View File

@@ -40,6 +40,11 @@ public:
return this->task->get_resp();
}
const protocol::RedisResponse *get_resp() const
{
return this->task->get_resp();
}
public:
/* User needs to call 'release()' exactly once, anywhere. */
void release()

View File

@@ -67,6 +67,9 @@ public:
INPUT *get_input() { return &this->input; }
OUTPUT *get_output() { return &this->output; }
const INPUT *get_input() const { return &this->input; }
const OUTPUT *get_output() const { return &this->output; }
public:
void *user_data;
@@ -133,6 +136,9 @@ public:
REQ *get_req() { return &this->req; }
RESP *get_resp() { return &this->resp; }
const REQ *get_req() const { return &this->req; }
const RESP *get_resp() const { return &this->resp; }
public:
void *user_data;
@@ -330,6 +336,8 @@ public:
public:
ARGS *get_args() { return &this->args; }
const ARGS *get_args() const { return &this->args; }
long get_retval() const
{
if (this->state == WFT_STATE_SUCCESS)