public async Task <TResult> ExecuteTransaction <TResult>(string requestId, TPartition partitionKey, Func <IHumanInterfaceConnectorMessageSession, Task <TResult> > transaction)
        {
            var transactionRecordContainer = applicationStateStore.Create(partitionKey);

            var outcome = await processor.Process(requestId, transactionRecordContainer, null, async (ctx, transactionContext) =>
            {
                var session = new HumanInterfaceConnectorMessageSession(requestId, transactionContext, rootMessageSession, messageStore);
                var result  = await transaction(session).ConfigureAwait(false);
                await transactionInProgressStore.BeginTransaction(requestId, transactionRecordContainer.UniqueIdentifier).ConfigureAwait(false);
                return(ProcessingResult <TResult> .Successful(result));
            });

            return(outcome.Value); //Duplicate check is ignored in the human interface
        }
Esempio n. 2
0
 public ITransactionRecordContainer Create(Type messageType, Dictionary <string, string> messageHeaders, object messageBody)
 {
     return(applicationStateStore.Create(
                correlationManager.GetPartitionKey(messageType, messageHeaders, messageBody)));
 }
 public ITransactionRecordContainer Create(T partitionKey)
 {
     return(impl.Create(partitionKey));
 }