public static async Task <BlobFetchResult> FromCache(BlobFetchCache blobFetchCache)
            {
                var sw = Stopwatch.StartNew();

                using var blob = await blobFetchCache.GetBlob();

                if (blob == null)
                {
                    return(null);
                }

                var source = new StreamSource(blob.OpenRead(), true);
                var result = new BlobFetchResult()
                {
                    streamSource = source,
                    blob         = blob,
                    bytes        = await source.GetBytesAsync(CancellationToken.None)
                };

                sw.Stop();
                GlobalPerf.BlobRead(sw.ElapsedTicks, result.bytes.Count);
                return(result);
            }
예제 #2
0
 public Task <IBlobData> GetPrimaryBlob()
 {
     return(primaryBlob.GetBlob());
 }