private async Task SynchronizeAssets() { _synchronize = false; var remoteHostClient = await _service.GetRemoteHostClientAsync(ShutdownCancellationToken).ConfigureAwait(false); if (remoteHostClient == null) { return; } var solution = _service.Workspace.CurrentSolution; using (var session = await remoteHostClient.CreateServiceSessionAsync(WellKnownRemoteHostServices.RemoteHostService, solution, ShutdownCancellationToken).ConfigureAwait(false)) { // ask remote host to sync initial asset await session.InvokeAsync(WellKnownRemoteHostServices.RemoteHostService_SynchronizeAsync).ConfigureAwait(false); } }
private async Task SynchronizePrimaryWorkspaceAsync(CancellationToken cancellationToken) { var remoteHostClient = await _service.GetRemoteHostClientAsync(cancellationToken).ConfigureAwait(false); if (remoteHostClient == null) { return; } using (Logger.LogBlock(FunctionId.SolutionChecksumUpdater_SynchronizePrimaryWorkspace, cancellationToken)) { var solution = _service.Workspace.CurrentSolution; var checksum = await solution.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false); await remoteHostClient.RunOnRemoteHostAsync( WellKnownRemoteHostServices.RemoteHostService, solution, nameof(IRemoteHostService.SynchronizePrimaryWorkspaceAsync), checksum, cancellationToken).ConfigureAwait(false); } }
private async Task SynchronizePrimaryWorkspaceAsync(CancellationToken cancellationToken) { var remoteHostClient = await _service.GetRemoteHostClientAsync(cancellationToken).ConfigureAwait(false); if (remoteHostClient == null) { return; } using (Logger.LogBlock(FunctionId.SolutionChecksumUpdater_SynchronizePrimaryWorkspace, cancellationToken)) { var solution = _service.Workspace.CurrentSolution; using (var session = await remoteHostClient.CreateServiceSessionAsync(WellKnownRemoteHostServices.RemoteHostService, solution, cancellationToken).ConfigureAwait(false)) { // ask remote host to sync initial asset var checksum = await solution.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false); await session.InvokeAsync(WellKnownRemoteHostServices.RemoteHostService_SynchronizePrimaryWorkspaceAsync, checksum).ConfigureAwait(false); } } }
private void CreateInitialSolutionChecksum() { // initial solution checksum creation won't be affected by global operation. // cancellation can only happen if it is being shutdown. Task.Run(async() => { await UpdateSolutionChecksumAsync(ShutdownCancellationToken).ConfigureAwait(false); var remoteHostClient = await _service.GetRemoteHostClientAsync(ShutdownCancellationToken).ConfigureAwait(false); if (remoteHostClient == null) { return; } var solution = _service.Workspace.CurrentSolution; using (var session = await remoteHostClient.CreateServiceSessionAsync(WellKnownRemoteHostServices.RemoteHostService, solution, ShutdownCancellationToken).ConfigureAwait(false)) { // ask remote host to sync initial asset await session.InvokeAsync(WellKnownRemoteHostServices.RemoteHostService_SynchronizeAsync).ConfigureAwait(false); } }, ShutdownCancellationToken); }