mirror of
https://github.com/sphildreth/roadie
synced 2024-11-26 22:20:21 +00:00
23 lines
No EOL
707 B
C#
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;
|
|
}
|
|
}
|
|
} |