@@ -67,57 +67,61 @@ public static AtomicScopedAsyncConcurrentLruBuilder<K, V> AsScopedCache<K, V>(th
6767 }
6868
6969 /// <summary>
70- /// Execute the cache's GetOrAdd value factory atomically, such that it is applied at most once per key. Other threads
71- /// attempting to update the same key will be blocked until value factory completes.
70+ /// Execute the cache's GetOrAdd method atomically, such that it is applied at most once per key. Other threads
71+ /// attempting to update the same key will be blocked until value factory completes. Incurs a small performance
72+ /// penalty.
7273 /// </summary>
7374 /// <typeparam name="K">The type of keys in the cache.</typeparam>
7475 /// <typeparam name="V">The type of values in the cache.</typeparam>
7576 /// <param name="builder">The ConcurrentLruBuilder to chain method calls onto.</param>
7677 /// <returns>An AtomicConcurrentLruBuilder.</returns>
77- public static AtomicConcurrentLruBuilder < K , V > WithAtomicValueFactory < K , V > ( this ConcurrentLruBuilder < K , V > builder )
78+ public static AtomicConcurrentLruBuilder < K , V > WithAtomicGetOrAdd < K , V > ( this ConcurrentLruBuilder < K , V > builder )
7879 {
7980 var convertBuilder = new ConcurrentLruBuilder < K , AtomicFactory < K , V > > ( builder . info ) ;
8081 return new AtomicConcurrentLruBuilder < K , V > ( convertBuilder ) ;
8182 }
8283
8384 /// <summary>
84- /// Execute the cache's ScopedGetOrAdd value factory atomically, such that it is applied at most once per key. Other threads
85- /// attempting to update the same key will be blocked until value factory completes.
85+ /// Execute the cache's GetOrAdd method atomically, such that it is applied at most once per key. Other threads
86+ /// attempting to update the same key will be blocked until value factory completes. Incurs a small performance
87+ /// penalty.
8688 /// </summary>
8789 /// <typeparam name="K">The type of keys in the cache.</typeparam>
8890 /// <typeparam name="V">The type of values in the cache.</typeparam>
8991 /// <typeparam name="W">The wrapped value type.</typeparam>
9092 /// <param name="builder">The ScopedConcurrentLruBuilder to chain method calls onto.</param>
9193 /// <returns>An AtomicScopedConcurrentLruBuilder.</returns>
92- public static AtomicScopedConcurrentLruBuilder < K , V > WithAtomicValueFactory < K , V , W > ( this ScopedConcurrentLruBuilder < K , V , W > builder ) where V : IDisposable where W : IScoped < V >
94+ public static AtomicScopedConcurrentLruBuilder < K , V > WithAtomicGetOrAdd < K , V , W > ( this ScopedConcurrentLruBuilder < K , V , W > builder ) where V : IDisposable where W : IScoped < V >
9395 {
9496 var convertBuilder = new ConcurrentLruBuilder < K , ScopedAtomicFactory < K , V > > ( builder . info ) ;
9597 return new AtomicScopedConcurrentLruBuilder < K , V > ( convertBuilder ) ;
9698 }
9799
98100 /// <summary>
99- /// Execute the cache's GetOrAddAsync value factory atomically, such that it is applied at most once per key. Other threads
100- /// attempting to update the same key will wait on the same value factory task.
101+ /// Execute the cache's GetOrAdd method atomically, such that it is applied at most once per key. Other threads
102+ /// attempting to update the same key will be blocked until value factory completes. Incurs a small performance
103+ /// penalty.
101104 /// </summary>
102105 /// <typeparam name="K">The type of keys in the cache.</typeparam>
103106 /// <typeparam name="V">The type of values in the cache.</typeparam>
104107 /// <param name="builder">The AsyncConcurrentLruBuilder to chain method calls onto.</param>
105108 /// <returns>An AtomicAsyncConcurrentLruBuilder.</returns>
106- public static AtomicAsyncConcurrentLruBuilder < K , V > WithAtomicValueFactory < K , V > ( this AsyncConcurrentLruBuilder < K , V > builder )
109+ public static AtomicAsyncConcurrentLruBuilder < K , V > WithAtomicGetOrAdd < K , V > ( this AsyncConcurrentLruBuilder < K , V > builder )
107110 {
108111 var convertBuilder = new ConcurrentLruBuilder < K , AsyncAtomicFactory < K , V > > ( builder . info ) ;
109112 return new AtomicAsyncConcurrentLruBuilder < K , V > ( convertBuilder ) ;
110113 }
111114
112115 /// <summary>
113- /// Execute the cache's ScopedGetOrAddAsync value factory atomically, such that it is applied at most once per key. Other threads
114- /// attempting to update the same key will wait on the same value factory task.
116+ /// Execute the cache's GetOrAdd method atomically, such that it is applied at most once per key. Other threads
117+ /// attempting to update the same key will be blocked until value factory completes. Incurs a small performance
118+ /// penalty.
115119 /// </summary>
116120 /// <typeparam name="K">The type of keys in the cache.</typeparam>
117121 /// <typeparam name="V">The type of values in the cache.</typeparam>
118122 /// <param name="builder">The ScopedAsyncConcurrentLruBuilder to chain method calls onto.</param>
119123 /// <returns>An AtomicScopedAsyncConcurrentLruBuilder.</returns>
120- public static AtomicScopedAsyncConcurrentLruBuilder < K , V > WithAtomicValueFactory < K , V > ( this ScopedAsyncConcurrentLruBuilder < K , V > builder ) where V : IDisposable
124+ public static AtomicScopedAsyncConcurrentLruBuilder < K , V > WithAtomicGetOrAdd < K , V > ( this ScopedAsyncConcurrentLruBuilder < K , V > builder ) where V : IDisposable
121125 {
122126 var convertBuilder = new AsyncConcurrentLruBuilder < K , ScopedAsyncAtomicFactory < K , V > > ( builder . info ) ;
123127 return new AtomicScopedAsyncConcurrentLruBuilder < K , V > ( convertBuilder ) ;
0 commit comments