Beispiel #1
0
        public Task Ping(Guid transactionId, DateTime timeStamp, ITransactionParticipant participant)
        {
            if (commitQueue.Find(transactionId, timeStamp) != -1)
            {
                // no need to take special action now - the transaction is still
                // in the commit queue and its status is not yet determined.
                // confirmation or cancellation will be sent after committing or aborting.

                storageWorker.Notify(); // just in case the worker fell asleep or something
            }
            else
            {
                if (confirmationTasks.TryGetValue(transactionId, out var record))
                {
                    // re-send now
                    record.LastSent = null;
                    confirmationWorker.Notify();
                }
                else
                {
                    // we never heard of this transaction - so it must have aborted
                    participant.Cancel(transactionId, timeStamp, TransactionalStatus.PresumedAbort);
                }
            }
            return(Task.CompletedTask); // one-way, no response
        }