IImfReportCache Interface
Definition
- Namespace
- Bodu.Financial.ExchangeRates
- Assembly
- Bodu.Financial.ExchangeRates.Imf.dll
- Package
- Bodu.Financial.ExchangeRates.Imf 0.7.1
- Source
- IImfReportCache.cs
Caches the raw bytes of downloaded IMF monthly report files so they need not be re-fetched on every load.
public interface IImfReportCache
- Extension Methods
Remarks
A report for a closed month is immutable, so a cached entry for a past month is always fresh; the report for the current month is still accumulating business days, so it is treated as stale once it is older than a caller-supplied refresh interval. Implementations are expected to be resilient: a cache failure should manifest as a miss rather than an exception that breaks rate retrieval.
Methods
Store(ImfReportMonth, byte[])
Stores the bytes for a report month, replacing any existing entry.
void Store(ImfReportMonth month, byte[] bytes)
Parameters
monthImfReportMonthThe report month whose file is being cached.
bytesbyte[]The report bytes to store.
TryGet(ImfReportMonth, TimeSpan, out byte[])
Attempts to retrieve the cached bytes for a report month.
bool TryGet(ImfReportMonth month, TimeSpan refreshInterval, out byte[] bytes)
Parameters
monthImfReportMonthThe report month whose file is requested.
refreshIntervalTimeSpanThe maximum age at which a current-month report is still considered fresh.
bytesbyte[]When this method returns true, the cached report bytes; otherwise null.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |