6#include <userver/engine/io/sys_linux/inotify.hpp>
7#include <userver/fs/read.hpp>
8#include <userver/rcu/rcu_map.hpp>
9#include <userver/utils/periodic_task.hpp>
11USERVER_NAMESPACE_BEGIN
19class FsCacheClient
final {
26 FsCacheClient(std::string_view dir, std::chrono::milliseconds update_period,
27 engine::TaskProcessor& tp);
33 FileInfoWithDataConstPtr
TryGetFile(std::string_view path)
const;
42 void HandleDelete(
const std::string& path);
44 static void HandleDeleteDirectory(engine::
io::sys_linux::Inotify& inotify,
45 const std::string& path);
47 void HandleCreate(
const std::string& path);
49 void HandleCreateDirectory(engine::
io::sys_linux::Inotify& inotify,
50 const std::string& path);
53 const std::string dir_;
54 const std::chrono::milliseconds update_period_;
55 engine::TaskProcessor& tp_;
57 utils::PeriodicTask cache_updater_;
59 rcu::RcuMap<std::string,
const fs::FileInfoWithData> data_;
62 engine::
Task inotify_task_;