Clio develop
The XRP Ledger API server.
|
A simple cache holding one ripple::LedgerHeader
to reduce DB lookups.
More...
#include <LedgerHeaderCache.hpp>
Classes | |
struct | CacheEntry |
Struct to store ledger header cache entry and the sequence it belongs to. More... | |
Public Member Functions | |
void | put (CacheEntry const &cacheEntry) |
Put CacheEntry into thread-safe container. | |
std::optional< CacheEntry > | get () const |
Read CacheEntry from thread-safe container. | |
A simple cache holding one ripple::LedgerHeader
to reduce DB lookups.
Used internally by backend implementations. When a ledger header is fetched via FetchLedgerBySeq
(often triggered by RPC commands), the result can be stored here. Subsequent requests for the same ledger sequence can proceed to retrieve the header from this cache, avoiding unnecessary database reads and improving performance.
std::optional< FetchLedgerCache::CacheEntry > data::FetchLedgerCache::get | ( | ) | const |
Read CacheEntry from thread-safe container.
void data::FetchLedgerCache::put | ( | CacheEntry const & | cacheEntry | ) |
Put CacheEntry into thread-safe container.
cacheEntry | The Cache to store into thread-safe container. |