9#include <userver/cache/cache_statistics.hpp>
10#include <userver/cache/update_type.hpp>
11#include <userver/components/component_fwd.hpp>
12#include <userver/dump/fwd.hpp>
13#include <userver/engine/task/task_processor_fwd.hpp>
14#include <userver/rcu/fwd.hpp>
15#include <userver/utils/flags.hpp>
17USERVER_NAMESPACE_BEGIN
21struct CacheDependencies;
44 const std::string&
Name()
const;
49 CacheUpdateTrait(
const components::ComponentConfig& config,
53 explicit CacheUpdateTrait(CacheDependencies&& dependencies);
55 virtual ~CacheUpdateTrait();
74 void AssertPeriodicUpdateStarted();
82 rcu::ReadablePtr<Config> GetConfig()
const;
86 bool HasPreAssignCheck()
const;
89 void SetDataSizeStatistic(std::size_t size)
noexcept;
93 engine::TaskProcessor& GetCacheTaskProcessor()
const;
128 const std::chrono::system_clock::time_point& last_update,
129 const std::chrono::system_clock::time_point& now,
130 UpdateStatisticsScope& stats_scope) = 0;
133 virtual void Cleanup() = 0;
135 virtual void MarkAsExpired();
137 virtual void GetAndWrite(
dump::
Writer& writer)
const;
139 virtual void ReadAndSet(
dump::
Reader& reader);
142 std::unique_ptr<Impl> impl_;