Example #1
0
 private PinnedRemotableDataScope(
     AssetStorages storages,
     AssetStorages.Storage storage,
     PinnedSolutionInfo solutionInfo)
 {
     _storages    = storages;
     _storage     = storage;
     SolutionInfo = solutionInfo;
 }
Example #2
0
        public async ValueTask <PinnedRemotableDataScope> CreatePinnedRemotableDataScopeAsync(Solution solution, CancellationToken cancellationToken)
        {
            using (Logger.LogBlock(FunctionId.SolutionSynchronizationServiceFactory_CreatePinnedRemotableDataScopeAsync, cancellationToken))
            {
                var storage  = AssetStorages.CreateStorage(solution.State);
                var checksum = await solution.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false);

                return(PinnedRemotableDataScope.Create(_assetStorages, storage, checksum));
            }
        }
Example #3
0
        public static PinnedRemotableDataScope Create(
            AssetStorages storages,
            AssetStorages.Storage storage,
            Checksum solutionChecksum)
        {
            Contract.ThrowIfNull(solutionChecksum);

            var solutionInfo = new PinnedSolutionInfo(
                Interlocked.Increment(ref s_scopeId),
                storage.SolutionState.BranchId == storage.SolutionState.Workspace.PrimaryBranchId,
                storage.SolutionState.WorkspaceVersion,
                solutionChecksum);

            storages.RegisterSnapshot(solutionInfo.ScopeId, storage);

            return(new PinnedRemotableDataScope(storages, storage, solutionInfo));
        }
Example #4
0
 private RemotableDataService(AssetStorages storages)
 {
     _assetStorages = storages;
 }