Exemple #1
0
 protected override LockTransactionResult DoExecuteLockTransaction(LockSession session, LockTransaction transaction)
 {
     return(Contracts.ServiceClientHub.CallWithRetry <Contracts.ILockerClient, LockTransactionResult>
            (
                (locker) => locker.ExecuteLockTransaction(session.Data, transaction),
                session.ServerHosts
            ));
 }
Exemple #2
0
 protected override Task <LockTransactionResult> DoExecuteLockTransactionAsync(LockSession session, LockTransaction transaction)
 {
     return(Contracts.ServiceClientHub.CallWithRetryAsync <Contracts.ILockerClient, LockTransactionResult>
            (
                (locker) => locker.Async_ExecuteLockTransaction(session.Data, transaction).AsTaskReturning <LockTransactionResult>(),
                session.ServerHosts
            ));
 }
Exemple #3
0
 protected abstract LockTransactionResult DoExecuteLockTransaction(LockSession session, LockTransaction transaction);
Exemple #4
0
 protected abstract Task <LockTransactionResult> DoExecuteLockTransactionAsync(LockSession session, LockTransaction transaction);
Exemple #5
0
        public Task <LockTransactionResult> ExecuteLockTransactionAsync(LockSession session, LockTransaction transaction)
        {
            if (!Running)
            {
                return(Task.FromResult(LockTransactionResult.CallFailed));
            }

            if (session == null || transaction == null)
            {
                throw new LockingException(StringConsts.ARGUMENT_ERROR + GetType().Name + ".ExecuteLockTransactionAsync(session|tran==null)");
            }

            checkSessionExists(session);

            if (m_InstrumentationEnabled)
            {
                m_Stats.IncrementLong(session.Path);
            }

            return(DoExecuteLockTransactionAsync(session, transaction));
        }
 protected override Task <LockTransactionResult> DoExecuteLockTransactionAsync(LockSession session, LockTransaction transaction)
 {
     return(TaskUtils.AsCompletedTask(() => m_Server.ExecuteLockTransaction(session.Data, transaction)));
 }
 protected override LockTransactionResult DoExecuteLockTransaction(LockSession session, LockTransaction transaction)
 {
     return(m_Server.ExecuteLockTransaction(session.Data, transaction));
 }
Exemple #8
0
 public Task <LockTransactionResult> ExecuteLockTransactionAsync(LockSession session, LockTransaction transaction)
 {
     return(Task.FromResult(ExecuteLockTransaction(session, transaction)));
 }
Exemple #9
0
 public LockTransactionResult ExecuteLockTransaction(LockSession session, LockTransaction transaction)
 {
     return(new LockTransactionResult(Guid.Empty, null, LockStatus.TransactionOK, LockErrorCause.Unspecified, null, 0, 0d, null));
 }