diff options
author | komels <komels@yandex-team.ru> | 2022-04-14 13:10:53 +0300 |
---|---|---|
committer | komels <komels@yandex-team.ru> | 2022-04-14 13:10:53 +0300 |
commit | 21c9b0e6b039e9765eb414c406c2b86e8cea6850 (patch) | |
tree | f40ebc18ff8958dfbd189954ad024043ca983ea5 /kikimr/persqueue/sdk/deprecated/cpp/v2/impl/channel.h | |
parent | 9a4effa852abe489707139c2b260dccc6f4f9aa9 (diff) | |
download | ydb-21c9b0e6b039e9765eb414c406c2b86e8cea6850.tar.gz |
Final part on compatibility layer: LOGBROKER-7215
ref:777c67aadbf705d19034a09a792b2df61ba53697
Diffstat (limited to 'kikimr/persqueue/sdk/deprecated/cpp/v2/impl/channel.h')
-rw-r--r-- | kikimr/persqueue/sdk/deprecated/cpp/v2/impl/channel.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/kikimr/persqueue/sdk/deprecated/cpp/v2/impl/channel.h b/kikimr/persqueue/sdk/deprecated/cpp/v2/impl/channel.h new file mode 100644 index 0000000000..630b097675 --- /dev/null +++ b/kikimr/persqueue/sdk/deprecated/cpp/v2/impl/channel.h @@ -0,0 +1,50 @@ +#pragma once + +#include <kikimr/persqueue/sdk/deprecated/cpp/v2/types.h> +#include <kikimr/persqueue/sdk/deprecated/cpp/v2/responses.h> + +#include <library/cpp/threading/future/future.h> + +#include <deque> + +namespace NPersQueue { + +struct TChannelInfo { + std::shared_ptr<grpc::Channel> Channel; + ui64 ProxyCookie; +}; + +class TChannel; +using TChannelPtr = TIntrusivePtr<TChannel>; + +class TPQLibPrivate; + +struct TChannelHolder { + TChannelPtr ChannelPtr; + NThreading::TFuture<TChannelInfo> ChannelInfo; +}; + +class TChannelImpl; +using TChannelImplPtr = TIntrusivePtr<TChannelImpl>; + +class TChannel: public TAtomicRefCount<TChannel> { +public: + friend class TPQLibPrivate; + + NThreading::TFuture<TChannelInfo> GetChannel(); + + ~TChannel(); + + void Start(); + +private: + TChannel(const TServerSetting& server, const std::shared_ptr<ICredentialsProvider>& credentialsProvider, TPQLibPrivate* pqLib, + TIntrusivePtr<ILogger> logger = nullptr, bool preferLocalProxy = false); + TChannel(const TProducerSettings& settings, TPQLibPrivate* pqLib, + TIntrusivePtr<ILogger> logger = nullptr, bool preferLocalProxy = false); + void MakeImpl(const TServerSetting& server, const TCredProviderPtr&, TPQLibPrivate* pqLib, + TIntrusivePtr<ILogger> logger = nullptr, bool preferLocalProxy = false); + TChannelImplPtr Impl; +}; + +} |