Ejemplo n.º 1
0
 /// <summary>
 /// Remote API.
 /// </summary>
 public Task GetAssetsAsync(int scopeId, Checksum[] checksums, string pipeName, CancellationToken cancellationToken)
 => RemoteEndPoint.WriteDataToNamedPipeAsync(
     pipeName,
     (scopeId, checksums),
     (writer, data, cancellationToken) => RemoteHostAssetSerialization.WriteDataAsync(
         writer, _workspaceServices.GetRequiredService <ISolutionAssetStorageProvider>().AssetStorage, _workspaceServices.GetRequiredService <ISerializerService>(), data.scopeId, data.checksums, cancellationToken),
     cancellationToken);
 public Task GetAssetsAsync(int scopeId, Checksum[] checksums, string pipeName, CancellationToken cancellationToken)
 => RemoteEndPoint.WriteDataToNamedPipeAsync(
     pipeName,
     (scopeId, checksums),
     (writer, data, cancellationToken) => RemoteHostAssetSerialization.WriteDataAsync(
         writer, _services.GetRequiredService <IRemotableDataService>(), data.scopeId, data.checksums, cancellationToken),
     cancellationToken);
Ejemplo n.º 3
0
        public async Task RequestAssetAsync(int scopeId, Checksum[] checksums, string pipeName, CancellationToken cancellationToken)
        {
            try
            {
                using var combinedCancellationToken = _shutdownCancellationSource.Token.CombineWith(cancellationToken);

                using (Logger.LogBlock(FunctionId.JsonRpcSession_RequestAssetAsync, pipeName, combinedCancellationToken.Token))
                {
                    await RemoteEndPoint.WriteDataToNamedPipeAsync(
                        pipeName,
                        (scopeId, checksums),
                        (writer, data, ct) => WriteAssetAsync(writer, data.scopeId, data.checksums, ct),
                        combinedCancellationToken.Token).ConfigureAwait(false);
                }
            }
            catch (Exception ex) when(_endPoint.ReportAndPropagateUnexpectedException(ex, cancellationToken))
            {
                throw ExceptionUtilities.Unreachable;
            }
        }