public static async Task <IAsyncEnumerable <T> > CreateLinqAsyncEnumerable <T>( this IReliableQueue <T> dictionary, Microsoft.ServiceFabric.Data.ITransaction txn) { var enumerable = await dictionary.CreateEnumerableAsync(txn).ConfigureAwait(false); return(enumerable.AsAsyncEnumerable()); }
public Task RemoveAsync(Fabric.ITransaction tx, Uri name, TimeSpan timeout) { Fabric.IReliableState result; this.store.TryRemove(name, out result); return(Task.FromResult(true)); }
public Task RemoveAsync(Fabric.ITransaction tx, string name) { Fabric.IReliableState result; this.store.TryRemove(this.ToUri(name), out result); return(Task.FromResult(true)); }
public static async Task <IAsyncEnumerable <KeyValuePair <TKey, TValue> > > CreateLinqAsyncEnumerable <TKey, TValue>( this IReliableDictionary <TKey, TValue> dictionary, Microsoft.ServiceFabric.Data.ITransaction txn, Func <TKey, bool> filter, EnumerationMode enumerationMode) where TKey : IComparable <TKey>, IEquatable <TKey> { var enumerable = await dictionary.CreateEnumerableAsync(txn, filter, enumerationMode).ConfigureAwait(false); return(enumerable.AsAsyncEnumerable()); }
public Task <T> GetOrAddAsync <T>(Fabric.ITransaction tx, Uri name, TimeSpan timeout) where T : Fabric.IReliableState { return(Task.FromResult((T)this.store.GetOrAdd(name, this.GetDependency(typeof(T))))); }
public ServiceFabricTransaction(ServiceFabricTransaction transaction) { _transaction = transaction.Tx; _transactionClosed = null; _ignoreCommits = true; }
public ServiceFabricTransaction(IReliableStateManager stateManager, Action <bool> transactionClosed) { _transaction = stateManager.CreateTransaction(); _transactionClosed = transactionClosed; _ignoreCommits = false; }
public Task ClearAsync(Fabric.ITransaction tx) { this.store.Clear(); return(Task.FromResult(true)); }
public Task <T> GetOrAddAsync <T>(Fabric.ITransaction tx, string name) where T : Fabric.IReliableState { return(Task.FromResult((T)this.store.GetOrAdd(this.ToUri(name), this.GetDependency(typeof(T))))); }