Contour.Transport.RabbitMQ.Internal.RabbitChannel.SafeNativeInvoke C# (CSharp) Method

SafeNativeInvoke() private method

The safe native invoke.
private SafeNativeInvoke ( Action invokeAction ) : void
invokeAction Action /// The invoke action. ///
return void
        private void SafeNativeInvoke(Action<IModel> invokeAction)
        {
            try
            {
                if (!this.isClosed)
                {
                    lock (this.sync)
                        invokeAction(this.Native);
                }
            }
            catch (AlreadyClosedException ex)
            {
                Logger.Warn("Cought exception. Marking Channel as failed.", ex);

                this.Failed(this, new ErrorEventArgs(ex));
            }
            catch (OperationInterruptedException ex)
            {
                Logger.Trace("Cought exception. Ignoring as part of shutdown process.", ex);

                this.Failed(this, new ErrorEventArgs(ex));
            }
        }