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

This commit is contained in:
Xie Han
2023-11-13 19:12:33 +08:00
4 changed files with 26 additions and 31 deletions

View File

@@ -664,26 +664,24 @@ void WFTaskFactory::reset_go_task(WFGoTask *task, FUNC&& func, ARGS&&... args)
{
auto&& tmp = std::bind(std::forward<FUNC>(func),
std::forward<ARGS>(args)...);
static_cast<__WFGoTask *>(task)->set_go_func(std::move(tmp));
((__WFGoTask *)task)->set_go_func(std::move(tmp));
}
/**********Create go task with nullptr func**********/
template<>
inline WFGoTask *WFTaskFactory::create_go_task<std::nullptr_t>
(const std::string& queue_name,
std::nullptr_t&& func)
template<> inline
WFGoTask *WFTaskFactory::create_go_task(const std::string& queue_name,
std::nullptr_t&& func)
{
return new __WFGoTask(WFGlobal::get_exec_queue(queue_name),
WFGlobal::get_compute_executor(),
nullptr);
}
template<>
inline WFGoTask *WFTaskFactory::create_timedgo_task<std::nullptr_t>
(time_t seconds, long nanoseconds,
const std::string& queue_name,
std::nullptr_t&& func)
template<> inline
WFGoTask *WFTaskFactory::create_timedgo_task(time_t seconds, long nanoseconds,
const std::string& queue_name,
std::nullptr_t&& func)
{
return new __WFTimedGoTask(seconds, nanoseconds,
WFGlobal::get_exec_queue(queue_name),
@@ -691,28 +689,25 @@ inline WFGoTask *WFTaskFactory::create_timedgo_task<std::nullptr_t>
nullptr);
}
template<>
inline WFGoTask *WFTaskFactory::create_go_task<std::nullptr_t>
(ExecQueue *queue, Executor *executor,
std::nullptr_t&& func)
template<> inline
WFGoTask *WFTaskFactory::create_go_task(ExecQueue *queue, Executor *executor,
std::nullptr_t&& func)
{
return new __WFGoTask(queue, executor, nullptr);
}
template<>
inline WFGoTask *WFTaskFactory::create_timedgo_task<std::nullptr_t>
(time_t seconds, long nanoseconds,
ExecQueue *queue, Executor *executor,
std::nullptr_t&& func)
template<> inline
WFGoTask *WFTaskFactory::create_timedgo_task(time_t seconds, long nanoseconds,
ExecQueue *queue, Executor *executor,
std::nullptr_t&& func)
{
return new __WFTimedGoTask(seconds, nanoseconds, queue, executor, nullptr);
}
template<>
inline void WFTaskFactory::reset_go_task<std::nullptr_t>
(WFGoTask *task, std::nullptr_t&& func)
template<> inline
void WFTaskFactory::reset_go_task(WFGoTask *task, std::nullptr_t&& func)
{
static_cast<__WFGoTask *>(task)->set_go_func(nullptr);
((__WFGoTask *)task)->set_go_func(nullptr);
}
/**********Template Thread Task Factory**********/

View File

@@ -36,8 +36,8 @@ static constexpr struct WFServerParams DNS_SERVER_PARAMS_DEFAULT =
.request_size_limit = (size_t)-1,
};
template<>
inline WFDnsServer::WFServer(dns_process_t proc) :
template<> inline
WFDnsServer::WFServer(dns_process_t proc) :
WFServerBase(&DNS_SERVER_PARAMS_DEFAULT),
process(std::move(proc))
{

View File

@@ -37,15 +37,15 @@ static constexpr struct WFServerParams HTTP_SERVER_PARAMS_DEFAULT =
.request_size_limit = (size_t)-1,
};
template<>
inline WFHttpServer::WFServer(http_process_t proc) :
template<> inline
WFHttpServer::WFServer(http_process_t proc) :
WFServerBase(&HTTP_SERVER_PARAMS_DEFAULT),
process(std::move(proc))
{
}
template<>
inline CommSession *WFHttpServer::new_session(long long seq, CommConnection *conn)
template<> inline
CommSession *WFHttpServer::new_session(long long seq, CommConnection *conn)
{
WFHttpTask *task;

View File

@@ -36,8 +36,8 @@ static constexpr struct WFServerParams REDIS_SERVER_PARAMS_DEFAULT =
.request_size_limit = (size_t)-1,
};
template<>
inline WFRedisServer::WFServer(redis_process_t proc) :
template<> inline
WFRedisServer::WFServer(redis_process_t proc) :
WFServerBase(&REDIS_SERVER_PARAMS_DEFAULT),
process(std::move(proc))
{