public override async Task <IList <(Checksum, object)> > RequestAssetsAsync(int scopeId, ISet <Checksum> checksums, ISerializerService serializerService, CancellationToken cancellationToken)
 {
     return(await _owner.RunServiceAsync(() =>
     {
         using (RoslynLogger.LogBlock(FunctionId.SnapshotService_RequestAssetAsync, GetRequestLogInfo, scopeId, checksums, cancellationToken))
         {
             return _owner.EndPoint.InvokeAsync(
                 WellKnownServiceHubServices.AssetService_RequestAssetAsync,
                 new object[] { scopeId, checksums.ToArray() },
                 (s, c) => Task.FromResult(ReadAssets(s, scopeId, checksums, serializerService, c)),
                 cancellationToken);
         }
     }, cancellationToken).ConfigureAwait(false));
 }
Esempio n. 2
0
 public override async Task <IList <(Checksum, object)> > RequestAssetsAsync(int scopeId, ISet <Checksum> checksums, ISerializerService serializerService, CancellationToken cancellationToken)
 {
     using (RoslynLogger.LogBlock(FunctionId.SnapshotService_RequestAssetAsync, GetRequestLogInfo, scopeId, checksums, cancellationToken))
     {
         // Surround this with a try/catch to report exceptions because we want to report any crashes here.
         try
         {
             return(await _owner.RunServiceAsync(() =>
             {
                 return _owner.InvokeAsync(WellKnownServiceHubServices.AssetService_RequestAssetAsync,
                                           new object[] { scopeId, checksums.ToArray() },
                                           (s, c) => ReadAssets(s, scopeId, checksums, serializerService, c), cancellationToken);
             }, cancellationToken).ConfigureAwait(false));
         }
         catch (Exception ex) when(ReportUnlessCanceled(ex, cancellationToken))
         {
             throw ExceptionUtilities.Unreachable;
         }
     }
 }
 public override async Task <IList <(Checksum, object)> > RequestAssetsAsync(int scopeId, ISet <Checksum> checksums, CancellationToken callerCancellation)
 {
     using (RoslynLogger.LogBlock(FunctionId.SnapshotService_RequestAssetAsync, GetRequestLogInfo, scopeId, checksums, callerCancellation))
     {
         try
         {
             return(await _owner.RunServiceAsync(cancellationToken =>
             {
                 return _owner.Rpc.InvokeAsync(WellKnownServiceHubServices.AssetService_RequestAssetAsync,
                                               new object[] { scopeId, checksums.ToArray() },
                                               (s, c) => ReadAssets(s, scopeId, checksums, c), cancellationToken);
             }, callerCancellation).ConfigureAwait(false));
         }
         catch (Exception ex) when(ReportUnlessCanceled(ex, callerCancellation))
         {
             throw ExceptionUtilities.Unreachable;
         }
     }
 }