Esempio n. 1
0
        void UnlockInstanceCallback(IAsyncResult result)
        {
            try
            {
                this.EndTryCommand(result);
            }
            catch (Exception exception)
            {
                if (Fx.IsFatal(exception))
                {
                    throw;
                }

                if (TD.UnlockInstanceExceptionIsEnabled())
                {
                    TD.UnlockInstanceException(exception.Message);
                }

                UnlockInstanceState unlockInstanceState = new UnlockInstanceState
                {
                    UnlockInstanceCommand = (UnlockInstanceCommand)(result.AsyncState),
                    BackoffTimeoutHelper  = new BackoffTimeoutHelper(TimeSpan.MaxValue)
                };

                unlockInstanceState.BackoffTimeoutHelper.WaitAndBackoff(this.scheduledUnlockInstance, unlockInstanceState);
            }
        }
Esempio n. 2
0
        private void ScheduledUnlockInstance(object state)
        {
            UnlockInstanceState   state2 = (UnlockInstanceState)state;
            UnlockInstanceCommand unlockInstanceCommand = state2.UnlockInstanceCommand;

            try
            {
                this.BeginTryCommandInternal(null, unlockInstanceCommand, TimeSpan.MaxValue, this.unlockInstanceCallback, unlockInstanceCommand);
            }
            catch (Exception exception)
            {
                if (Fx.IsFatal(exception))
                {
                    throw;
                }
                if (TD.UnlockInstanceExceptionIsEnabled())
                {
                    TD.UnlockInstanceException(exception.Message);
                }
                state2.BackoffTimeoutHelper.WaitAndBackoff(this.scheduledUnlockInstance, state2);
            }
        }
Esempio n. 3
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);
            }
        }