diff options
author | kulikov <kulikov@yandex-team.com> | 2023-07-27 12:28:50 +0300 |
---|---|---|
committer | kulikov <kulikov@yandex-team.com> | 2023-07-27 12:28:50 +0300 |
commit | 4a7691c519e6114e013dc1dd0c3b2528154507f9 (patch) | |
tree | af6ee3a210f95bb4532036b1f1a5352ef072068a /library/cpp/http/server/http.cpp | |
parent | dcde92436ae71c3fdf1d6b9916e3858f3b35146e (diff) | |
download | ydb-4a7691c519e6114e013dc1dd0c3b2528154507f9.tar.gz |
revert rXXXXXX (see discusstion in pr), will commit again more pci-dss friendly way
Diffstat (limited to 'library/cpp/http/server/http.cpp')
-rw-r--r-- | library/cpp/http/server/http.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index ecdd93ab56..2dd407dcef 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -2,7 +2,6 @@ #include "http_ex.h" #include <library/cpp/threading/equeue/equeue.h> -#include <library/cpp/threading/equeue/fast.h> #include <util/generic/buffer.h> #include <util/generic/intrlist.h> @@ -406,8 +405,8 @@ public: : TImpl( parent, cb, - MakeThreadPool<TSimpleThreadPool>(factory, options, cb, options.RequestsThreadName), - MakeThreadPool<TThreadPool>(factory, options, nullptr, options.FailRequestsThreadName), + MakeThreadPool<TSimpleThreadPool>(factory, options.UseElasticQueues, cb, options.RequestsThreadName), + MakeThreadPool<TThreadPool>(factory, options.UseElasticQueues, nullptr, options.FailRequestsThreadName), options) { } @@ -457,30 +456,21 @@ public: private: template <class TThreadPool_> - static THolder<IThreadPool> MakeThreadPool(ICallBack* callback, const IThreadPool::TParams& params) { - if (callback) { - return MakeHolder<TThreadPoolBinder<TThreadPool_, THttpServer::ICallBack>>(callback, params); - } else { - return MakeHolder<TThreadPool_>(params); - } - } - - template <class TThreadPool_> - static THolder<IThreadPool> MakeThreadPool(IThreadFactory* factory, const TOptions& options, ICallBack* callback = nullptr, const TString& threadName = {}) { + static THolder<IThreadPool> MakeThreadPool(IThreadFactory* factory, bool elastic, ICallBack* callback = nullptr, const TString& threadName = {}) { if (!factory) { factory = SystemThreadFactory(); } THolder<IThreadPool> pool; const auto params = IThreadPool::TParams().SetFactory(factory).SetThreadName(threadName); - - if (options.UseFastElasticQueues) { - pool = MakeThreadPool<TFastElasticQueue>(callback, params); + if (callback) { + pool = MakeHolder<TThreadPoolBinder<TThreadPool_, THttpServer::ICallBack>>(callback, params); } else { - pool = MakeThreadPool<TThreadPool_>(callback, params); - if (options.UseElasticQueues) { - pool = MakeHolder<TElasticQueue>(std::move(pool)); - } + pool = MakeHolder<TThreadPool_>(params); + } + + if (elastic) { + pool = MakeHolder<TElasticQueue>(std::move(pool)); } return pool; |