diff options
author | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
commit | b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806 (patch) | |
tree | 2a23209faf0fea5586a6d4b9cee60d1b318d29fe /library/cpp/http/client/client.h | |
parent | 559174a9144de40d6bb3997ea4073c82289b4974 (diff) | |
download | ydb-b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806.tar.gz |
remove kikimr/driver DEPENDS
Diffstat (limited to 'library/cpp/http/client/client.h')
-rw-r--r-- | library/cpp/http/client/client.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/library/cpp/http/client/client.h b/library/cpp/http/client/client.h deleted file mode 100644 index 717601989ef..00000000000 --- a/library/cpp/http/client/client.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include "query.h" -#include "request.h" - -namespace NHttp { - struct TClientOptions { -#define DECLARE_FIELD(name, type, default) \ - type name{default}; \ - inline TClientOptions& Set##name(const type& value) { \ - name = value; \ - return *this; \ - } - - /// The size of stack of fetching coroutine. - DECLARE_FIELD(ExecutorStackSize, size_t, 1 << 20); - - /// The number of fetching coroutines. - DECLARE_FIELD(FetchCoroutines, size_t, 3); - - DECLARE_FIELD(Name, TString, "GlobalFetcher"); - - /// The lifetime of entries in the DNS cache (if zero then cache is not used). - DECLARE_FIELD(DnsCacheLifetime, TDuration, TDuration::Zero()); - - /// Established connections will be keept for further usage. - DECLARE_FIELD(KeepAlive, bool, false); - - /// How long established connections should be keept. - DECLARE_FIELD(KeepAliveTimeout, TDuration, TDuration::Minutes(5)); - -#undef DECLARE_FIELD - }; - - /** - * Statefull fetching client. - * Can handle multiply fetching request simultaneously. Also it's may apply - * politeness policy to control load of each host. - */ - class TFetchClient { - public: - explicit TFetchClient(const TClientOptions& options = TClientOptions()); - ~TFetchClient(); - - /// Execute give fetch request in asynchronous fashion. - TFetchState Fetch(const TFetchQuery& query, NHttpFetcher::TCallBack cb); - - private: - class TImpl; - THolder<TImpl> Impl_; - }; - - /// Execute give fetch request in synchronous fashion. - NHttpFetcher::TResultRef Fetch(const TFetchQuery& query); - - /// Execute give fetch request in asynchronous fashion. - TFetchState FetchAsync(const TFetchQuery& query, NHttpFetcher::TCallBack cb); - -} |