Skip to content
Merged

docs #169

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions BitFaster.Caching/CachePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

namespace BitFaster.Caching
{
/// <summary>
/// Represents the cache policy. Cache policy is dependent on the parameters chosen
/// when constructing the cache.
/// </summary>
public class CachePolicy
{
public CachePolicy(IBoundedPolicy eviction, ITimePolicy expireAfterWrite)
Expand All @@ -14,8 +18,16 @@ public CachePolicy(IBoundedPolicy eviction, ITimePolicy expireAfterWrite)
this.ExpireAfterWrite = expireAfterWrite;
}

/// <summary>
/// Gets the bounded size eviction policy. This policy evicts items from the cache
/// if it exceeds capacity.
/// </summary>
public IBoundedPolicy Eviction { get; }

/// <summary>
/// Gets the expire after write policy, if any. This policy evicts items after a
/// fixed duration since an entry's creation or most recent replacement.
/// </summary>
public ITimePolicy ExpireAfterWrite { get; }
}
}
3 changes: 3 additions & 0 deletions BitFaster.Caching/IAsyncCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public interface IAsyncCache<K, V> : IEnumerable<KeyValuePair<K, V>>
/// </summary>
ICacheEvents<K, V> Events { get; }

/// <summary>
/// Gets the cache policy.
/// </summary>
CachePolicy Policy { get; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions BitFaster.Caching/IBoundedPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace BitFaster.Caching
{
/// <summary>
/// Represents a bounded size cache policy.
/// </summary>
public interface IBoundedPolicy
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions BitFaster.Caching/ICache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public interface ICache<K, V> : IEnumerable<KeyValuePair<K, V>>
/// </summary>
ICacheEvents<K, V> Events { get; }

/// <summary>
/// Gets the cache policy.
/// </summary>
CachePolicy Policy { get; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions BitFaster.Caching/IScopedAsyncCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public interface IScopedAsyncCache<K, V> : IEnumerable<KeyValuePair<K, Scoped<V>
/// </remarks>
ICacheEvents<K, Scoped<V>> Events { get; }

/// <summary>
/// Gets the cache policy.
/// </summary>
CachePolicy Policy { get; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions BitFaster.Caching/IScopedCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public interface IScopedCache<K, V> : IEnumerable<KeyValuePair<K, Scoped<V>>> wh
/// </remarks>
ICacheEvents<K, Scoped<V>> Events { get; }

/// <summary>
/// Gets the cache policy.
/// </summary>
CachePolicy Policy { get; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions BitFaster.Caching/ITimePolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace BitFaster.Caching
{
/// <summary>
/// Represents a time based cache policy.
/// </summary>
public interface ITimePolicy
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions BitFaster.Caching/ScopedAsyncCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public ScopedAsyncCache(IAsyncCache<K, Scoped<V>> cache)
///<inheritdoc/>
public ICacheEvents<K, Scoped<V>> Events => this.cache.Events;

///<inheritdoc/>
public CachePolicy Policy => this.cache.Policy;

///<inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions BitFaster.Caching/ScopedCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public ScopedCache(ICache<K, Scoped<V>> cache)
///<inheritdoc/>
public ICacheEvents<K, Scoped<V>> Events => this.cache.Events;

///<inheritdoc/>
public CachePolicy Policy => this.cache.Policy;

///<inheritdoc/>
Expand Down