示例#1
0
        public TResult Get(TKey key)
        {
            var reference = cache.Get(key);

            if (!reference.TryGetTarget(out var ret))
            {
                cache.Forget(key);
                ret = Get(key); // will not loop because Forget means the TryGetTarget will succeed next time
            }
            lastResult = null !;
            return(ret);
        }
示例#2
0
 public Task <TResult> Get(TKey key) => cache.Get(key).Task;