userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
component_base.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <optional>
7
#include <string>
8
9
#include <
userver/components/component_base.hpp
>
10
#include <
userver/ydb/dist_lock/worker.hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
testsuite
{
15
class
TestsuiteTasks
;
16
}
// namespace testsuite
17
18
namespace
ydb {
19
41
class
DistLockComponentBase :
public
components::ComponentBase
{
42
public
:
43
DistLockComponentBase(
const
components::ComponentConfig
&,
const
components::ComponentContext
&);
44
55
bool
OwnsLock
() const noexcept;
56
57
static
yaml_config
::Schema GetStaticConfigSchema();
58
59
protected:
73
virtual
void
DoWork
() = 0;
74
84
virtual
void
DoWorkTestsuite
() {
DoWork
(); }
85
87
void
Start
();
88
90
void
Stop
() noexcept;
91
92
private:
93
testsuite
::TestsuiteTasks& testsuite_tasks_;
94
const
std
::
string
testsuite_task_name_;
95
96
// Worker contains a task that may refer to other fields, so it must be right
97
// before subscriptions. Add new fields above this comment.
98
std
::optional<
DistLockedWorker
> worker_;
99
};
100
101
}
// namespace ydb
102
103
USERVER_NAMESPACE_END
userver
ydb
dist_lock
component_base.hpp
Generated on
for userver by
Doxygen
1.17.0