39 template<
typename K,
typename V,
typename M = std::mutex>
41 private boost::noncopyable {
45 std::size_t cacheCapacity,
46 std::chrono::seconds syncInterval =
47 std::chrono::duration_cast<std::chrono::seconds>(
52 std::shared_ptr<folly::Executor>
executor,
54 std::size_t cacheCapacity,
55 std::chrono::seconds syncInterval,
67 void put(
const K& key,
const V&
val)
override {
71 bool remove(
const K& key)
override {
75 void clear(
bool clearPersistence =
false)
override {
void put(const K &key, const V &val) override
LRUPersistentCache< K, V, M >::Ptr cache_
void clear(bool clearPersistence=false) override
bool remove(const K &key) override
folly::Optional< V > get(const K &key) override
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
FilePersistentCache(const std::string &file, std::size_t cacheCapacity, std::chrono::seconds syncInterval=std::chrono::duration_cast< std::chrono::seconds >(client::persistence::DEFAULT_CACHE_SYNC_INTERVAL), int nSyncRetries=client::persistence::DEFAULT_CACHE_SYNC_RETRIES)
void setSyncOnDestroy(bool syncOnDestroy)
constexpr std::chrono::milliseconds DEFAULT_CACHE_SYNC_INTERVAL
constexpr int DEFAULT_CACHE_SYNC_RETRIES
void clear(bool clearPersistence=false) override
void setSyncOnDestroy(bool syncOnDestroy)
~FilePersistentCache() override
void put(const K &key, const V &val) override