コード例 #1
0
ファイル: Caffeine.cs プロジェクト: randyklex/caffeine.net
        public IAsyncLoadingCache <K, V> BuildAsync(AsyncCacheLoader <K, V> loader)
        {
            RequireWeightWithWeigher();

            if (IsWeakValues)
            {
                throw new InvalidOperationException("Weak values cannot be combined with AsyncLoadingCache.");
            }

            if (loader == null)
            {
                throw new ArgumentNullException("loader", "loader cannot be null.");
            }

            // TODO: implement this..
            //return (IsBounded || DoesRefreshAfterWrite) ? new BoundAsyncLoadingCache<K, V>(this, loader) : new UnboundedAsyncLoadingCache<K, V>(this, loader);
            throw new NotImplementedException();
        }
コード例 #2
0
 public UnboundedAsyncLoadingCache(Caffeine <K, Task <V> > builder, AsyncCacheLoader <K, V> loader)
     : base(new UnboundedLocalCache <K, Task <V> >(builder, true), loader)
 {
 }
コード例 #3
0
 internal LocalAsyncLoadingCache(C cache, AsyncCacheLoader <K, V> loader)
 {
     this.mLoader = loader;
     //this.canBulkLoad = canBulkLoad(loader);
     this.cache = cache;
 }