public Task <ICompletableSynchronizedStorageSession> TryAdapt(IOutboxTransaction transaction, ContextBag context, CancellationToken cancellationToken = default)
 {
     if (transaction is ServiceFabricOutboxTransaction outboxTransaction)
     {
         // this session will not own the transaction, the outbox part owns the transaction
         ICompletableSynchronizedStorageSession session = new StorageSession(outboxTransaction.StateManager, outboxTransaction.Transaction, outboxTransaction.TransactionTimeout, false);
         return(Task.FromResult(session));
     }
     return(EmptyTask);
 }
Exemplo n.º 2
0
        public Task <CompletableSynchronizedStorageSession> TryAdapt(OutboxTransaction transaction, ContextBag context)
        {
            var outboxTransaction = transaction as ServiceFabricOutboxTransaction;

            if (outboxTransaction != null)
            {
                // this session will not own the transaction, the outbox part owns the transaction
                CompletableSynchronizedStorageSession session = new StorageSession(outboxTransaction.Transaction);
                return(Task.FromResult(session));
            }
            return(EmptyTask);
        }
Exemplo n.º 3
0
 public static Task <IReliableDictionary <Guid, SagaEntry> > Sagas(this StorageSession session, string collectionName, CancellationToken cancellationToken = default)
 {
     return(session.StateManager.GetOrAddAsync <IReliableDictionary <Guid, SagaEntry> >(collectionName, session.TransactionTimeout));
 }
 public static Task <IReliableDictionary <Guid, SagaEntry> > Sagas(this StorageSession session, string collectionName)
 {
     return(session.StateManager.GetOrAddAsync <IReliableDictionary <Guid, SagaEntry> >(collectionName));
 }