1- using System . Linq . Expressions ;
1+
22using BitFaster . Caching . Lru . Builder ;
33
44namespace BitFaster . Caching . Lru
55{
66 /// <summary>
77 /// Factory class for creating ConcurrentLru variants.
88 /// </summary>
9- internal static class LruFactory < K , V >
9+ internal static class ConcurrentLru
1010 {
1111 /// <summary>
1212 /// Creates a ConcurrentLru instance based on the provided LruInfo.
1313 /// </summary>
1414 /// <param name="info">The LruInfo</param>
1515 /// <returns>A ConcurrentLru</returns>
16- internal static ICache < K , V > CreateConcurrent ( LruInfo < K > info )
16+ internal static ICache < K , V > Create < K , V > ( LruInfo < K > info )
1717 {
1818 if ( info . TimeToExpireAfterWrite . HasValue && info . TimeToExpireAfterAccess . HasValue )
1919 Throw . InvalidOp ( "Specifying both ExpireAfterWrite and ExpireAfterAccess is not supported." ) ;
@@ -23,13 +23,13 @@ internal static ICache<K, V> CreateConcurrent(LruInfo<K> info)
2323 ( true , false , false ) => new ConcurrentLru < K , V > ( info . ConcurrencyLevel , info . Capacity , info . KeyComparer ) ,
2424 ( true , true , false ) => new ConcurrentTLru < K , V > ( info . ConcurrencyLevel , info . Capacity , info . KeyComparer , info . TimeToExpireAfterWrite . Value ) ,
2525 ( false , true , false ) => new FastConcurrentTLru < K , V > ( info . ConcurrencyLevel , info . Capacity , info . KeyComparer , info . TimeToExpireAfterWrite . Value ) ,
26- ( true , false , true ) => CreateExpireAfterAccess < TelemetryPolicy < K , V > > ( info ) ,
27- ( false , false , true ) => CreateExpireAfterAccess < NoTelemetryPolicy < K , V > > ( info ) ,
26+ ( true , false , true ) => CreateExpireAfterAccess < K , V , TelemetryPolicy < K , V > > ( info ) ,
27+ ( false , false , true ) => CreateExpireAfterAccess < K , V , NoTelemetryPolicy < K , V > > ( info ) ,
2828 _ => new FastConcurrentLru < K , V > ( info . ConcurrencyLevel , info . Capacity , info . KeyComparer ) ,
2929 } ;
3030 }
3131
32- private static ICache < K , V > CreateExpireAfterAccess < TP > ( LruInfo < K > info ) where TP : struct , ITelemetryPolicy < K , V >
32+ private static ICache < K , V > CreateExpireAfterAccess < K , V , TP > ( LruInfo < K > info ) where TP : struct , ITelemetryPolicy < K , V >
3333 {
3434 return new ConcurrentLruCore < K , V , LongTickCountLruItem < K , V > , AfterAccessLongTicksPolicy < K , V > , TP > (
3535 info . ConcurrencyLevel , info . Capacity , info . KeyComparer , new AfterAccessLongTicksPolicy < K , V > ( info . TimeToExpireAfterAccess . Value ) , default ) ;
0 commit comments