Esempio n. 1
0
 private void UnlockInstanceCallback(IAsyncResult result)
 {
     try
     {
         this.EndTryCommand(result);
     }
     catch (Exception exception)
     {
         if (Fx.IsFatal(exception))
         {
             throw;
         }
         if (TD.UnlockInstanceExceptionIsEnabled())
         {
             TD.UnlockInstanceException(exception.Message);
         }
         UnlockInstanceState state = new UnlockInstanceState {
             UnlockInstanceCommand = (UnlockInstanceCommand)result.AsyncState,
             BackoffTimeoutHelper  = new BackoffTimeoutHelper(TimeSpan.MaxValue)
         };
         state.BackoffTimeoutHelper.WaitAndBackoff(this.scheduledUnlockInstance, state);
     }
 }
Esempio n. 2
0
        void ScheduledUnlockInstance(object state)
        {
            UnlockInstanceState   unlockInstanceState = (UnlockInstanceState)state;
            UnlockInstanceCommand command             = unlockInstanceState.UnlockInstanceCommand;

            try
            {
                this.BeginTryCommandInternal(null, command, TimeSpan.MaxValue, unlockInstanceCallback, command);
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                if (TD.UnlockInstanceExceptionIsEnabled())
                {
                    TD.UnlockInstanceException(e.Message);
                }
                // Keep on going - if problems are severe the host will be faulted and we'll give up then.
                unlockInstanceState.BackoffTimeoutHelper.WaitAndBackoff(this.scheduledUnlockInstance, unlockInstanceState);
            }
        }
 private void UnlockInstanceCallback(IAsyncResult result)
 {
     try
     {
         this.EndTryCommand(result);
     }
     catch (Exception exception)
     {
         if (Fx.IsFatal(exception))
         {
             throw;
         }
         if (TD.UnlockInstanceExceptionIsEnabled())
         {
             TD.UnlockInstanceException(exception.Message);
         }
         UnlockInstanceState state = new UnlockInstanceState {
             UnlockInstanceCommand = (UnlockInstanceCommand) result.AsyncState,
             BackoffTimeoutHelper = new BackoffTimeoutHelper(TimeSpan.MaxValue)
         };
         state.BackoffTimeoutHelper.WaitAndBackoff(this.scheduledUnlockInstance, state);
     }
 }