コード例 #1
0
 public PersistentStore(IReliableStateManager manager, string identifier, DataRetentionPolicy retentionPolicy)
 {
     Assert.IsNotNull(manager, "State manager can't be null");
     Assert.IsNotEmptyOrNull(identifier);
     Assert.IsNotNull(retentionPolicy);
     Assert.IsTrue(retentionPolicy is AgeBasedRetentionPolicy, string.Format(CultureInfo.InvariantCulture, "TargetType '{0}' Retention Policy not supported", retentionPolicy.GetType()));
     this.stateManager            = manager;
     this.storeIdentifier         = identifier;
     this.dataRetentionPolicy     = retentionPolicy as AgeBasedRetentionPolicy;
     this.metadataStoreIdentifier = identifier + MetadataStoreCollectionIdentifierSuffix;
 }
コード例 #2
0
        /// <inheritdoc />
        public async Task <IPersistentStore <string, string> > CreatePersistentStoreForStringsAsync(string storeIdentifier, DataRetentionPolicy retentionPolicy, CancellationToken token)
        {
            Assert.IsNotEmptyOrNull(storeIdentifier, "Identifier can't be null/empty");
            Assert.IsNotNull(retentionPolicy, "Retention Policy can't be null/empty");
            var store = new PersistentStore <string, string>(this.stateManager, storeIdentifier, retentionPolicy);
            await store.InitializeAsync(token).ConfigureAwait(false);

            this.allStringStringStores.Add(store);
            return(store);
        }