Github   Telegram
Loading...
Searching...
No Matches
Public Member Functions | List of all members
fs::FsCacheClient Class Referencefinal

Class client for storing files in memory Usually retrieved from components::FsCache More...

#include <userver/fs/fs_cache_client.hpp>

Public Member Functions

 FsCacheClient (std::string_view dir, std::chrono::milliseconds update_period, engine::TaskProcessor &tp)
 Fills the cache and starts periodic update. More...
 
FileInfoWithDataConstPtr TryGetFile (std::string_view path) const
 get file from memory More...
 
void UpdateCache ()
 Concurrency-safe cache update.
 

Detailed Description

Class client for storing files in memory Usually retrieved from components::FsCache

Definition at line 18 of file fs_cache_client.hpp.

Constructor & Destructor Documentation

◆ FsCacheClient()

fs::FsCacheClient::FsCacheClient ( std::string_view  dir,
std::chrono::milliseconds  update_period,
engine::TaskProcessor &  tp 
)

Fills the cache and starts periodic update.

Parameters
dirdirectory to cache files from
update_periodtime (0 - fill the cache only at startup)
tptask processor to do filesystem operations

Member Function Documentation

◆ TryGetFile()

FileInfoWithDataConstPtr fs::FsCacheClient::TryGetFile ( std::string_view  path) const

get file from memory

Parameters
pathto file
Returns
file info and content ; nullptr if no file with specified name on FS

The documentation for this class was generated from the following file: