roadie/RoadieLibrary/Caching/CachePolicy.cs
Steven Hildreth c0d5e5dc24 WIP
2018-11-04 14:33:37 -06:00

23 lines
No EOL
707 B
C#

using System;
namespace Roadie.Library.Caching
{
public sealed class CachePolicy
{
private readonly TimeSpan expiresAfter;
private readonly bool renewLeaseOnAccess;
public TimeSpan ExpiresAfter { get { return this.expiresAfter; } }
/// <summary>
/// If specified, each read of the item from the cache will reset the expiration time
/// </summary>
public bool RenewLeaseOnAccess { get { return this.renewLeaseOnAccess; } }
public CachePolicy(TimeSpan expiresAfter, bool renewLeaseOnAccess = false)
{
this.expiresAfter = expiresAfter;
this.renewLeaseOnAccess = renewLeaseOnAccess;
}
}
}