Ejemplo n.º 1
0
 private PinnedRemotableDataScope(
     AssetStorages storages,
     AssetStorages.Storage storage,
     PinnedSolutionInfo solutionInfo)
 {
     _storages    = storages;
     _storage     = storage;
     SolutionInfo = solutionInfo;
 }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 4
0
 private RemotableDataService(AssetStorages storages)
 {
     _assetStorages = storages;
 }