userver: userver/ydb/topic_writer_component.hpp Source File
Loading...
Searching...
No Matches
topic_writer_component.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/ydb/topic_writer_component.hpp
4/// @brief @copybrief ydb::TopicWriterComponent
5
6#include <memory>
7
8#include <userver/compiler/impl/lifetime.hpp>
9#include <userver/components/component_base.hpp>
10
11USERVER_NAMESPACE_BEGIN
12
13namespace ydb {
14
15class TopicWriterManager;
16
17/// @ingroup userver_components
18///
19/// @brief userver component for YDB topic writer
20///
21/// ## Static options of ydb::TopicWriterComponent :
22/// @include{doc} scripts/docs/en/components_schema/ydb/src/ydb/topic_writer_component.md
23///
24/// Options inherited from @ref components::ComponentBase :
25/// @include{doc} scripts/docs/en/components_schema/core/src/components/impl/component_base.md
26class TopicWriterComponent final : public components::ComponentBase {
27public:
28 /// Component name for use in static config
29 static constexpr std::string_view kName = "ydb-topic-writer";
30
31 TopicWriterComponent(const components::ComponentConfig&, const components::ComponentContext&);
32
33 ~TopicWriterComponent() final;
34
35 /// @brief Returns the underlying TopicWriterManager instance
36 TopicWriterManager& GetTopicWriterManager() USERVER_IMPL_LIFETIME_BOUND;
37
38 static yaml_config::Schema GetStaticConfigSchema();
39
40private:
41 std::shared_ptr<TopicWriterManager> writer_manager_;
42};
43
44} // namespace ydb
45
46USERVER_NAMESPACE_END