Exemplo n.º 1
0
        private IEnumerator <IAsyncResult> UpdateMessageImpl(IQueueMessageReceipt receipt, byte[] body, TimeSpan visibilityTimeout, TimeSpan?timeToLive, AsyncIteratorContext <IQueueMessageReceipt> context)
        {
            IAsyncResult  asyncResult;
            RemainingTime remainingTime = new RemainingTime(base.Timeout);

            try
            {
                this.InternalContainer.Timeout = StorageStampHelpers.AdjustTimeoutRange(remainingTime);
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            try
            {
                asyncResult = this.InternalContainer.BeginGetProperties(ContainerPropertyNames.None, null, context.GetResumeCallback(), context.GetResumeState("QueueContainer.GetMessageImpl"));
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndGetProperties(asyncResult);
            }
            catch (Exception exception2)
            {
                StorageStamp.TranslateException(exception2);
                throw;
            }
            try
            {
                this.InternalContainer.Timeout = remainingTime;
                asyncResult = this.InternalContainer.BeginUpdateMessage(receipt, body, visibilityTimeout, timeToLive, context.GetResumeCallback(), context.GetResumeState("QueueContainer.GetMessageImpl"));
            }
            catch (Exception exception3)
            {
                StorageStamp.TranslateException(exception3);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = this.InternalContainer.EndUpdateMessage(asyncResult);
            }
            catch (Exception exception4)
            {
                StorageStamp.TranslateException(exception4);
                throw;
            }
        }
Exemplo n.º 2
0
        private IEnumerator <IAsyncResult> PutMessageImpl(List <PushedMessage> messagesList, bool usePutMessageRowCommand, AsyncIteratorContext <List <IMessageData> > context)
        {
            IAsyncResult  asyncResult;
            RemainingTime remainingTime = new RemainingTime(base.Timeout);

            try
            {
                this.InternalContainer.Timeout = StorageStampHelpers.AdjustTimeoutRange(remainingTime);
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            try
            {
                asyncResult = this.InternalContainer.BeginGetProperties(ContainerPropertyNames.None, null, context.GetResumeCallback(), context.GetResumeState("QueueContainer.PutMessageImpl"));
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndGetProperties(asyncResult);
            }
            catch (Exception exception2)
            {
                StorageStamp.TranslateException(exception2);
                throw;
            }
            try
            {
                this.InternalContainer.Timeout = remainingTime;
                asyncResult = this.InternalContainer.BeginPutMessage(messagesList, usePutMessageRowCommand, context.GetResumeCallback(), context.GetResumeState("QueueContainer.PutMessageImpl"));
            }
            catch (Exception exception3)
            {
                StorageStamp.TranslateException(exception3);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = this.InternalContainer.EndPutMessage(asyncResult);
            }
            catch (Exception exception4)
            {
                StorageStamp.TranslateException(exception4);
                throw;
            }
        }
Exemplo n.º 3
0
        private IEnumerator <IAsyncResult> GetQueueStatisticsImpl(bool includeInvisibleMessages, bool includeExpiredMessages, AsyncIteratorContext <IQueueStatistics> context)
        {
            IAsyncResult  asyncResult;
            RemainingTime remainingTime = new RemainingTime(base.Timeout);

            try
            {
                this.InternalContainer.Timeout = StorageStampHelpers.AdjustTimeoutRange(remainingTime);
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            try
            {
                asyncResult = this.InternalContainer.BeginGetProperties(ContainerPropertyNames.None, null, context.GetResumeCallback(), context.GetResumeState("QueueContainer.GetMessageImpl"));
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndGetProperties(asyncResult);
            }
            catch (Exception exception2)
            {
                StorageStamp.TranslateException(exception2);
                throw;
            }
            try
            {
                this.InternalContainer.Timeout = remainingTime;
                asyncResult = this.InternalContainer.BeginGetQueueStatistics(includeInvisibleMessages, includeExpiredMessages, context.GetResumeCallback(), context.GetResumeState("QueueContainer.GetMessageImpl"));
            }
            catch (Exception exception3)
            {
                StorageStamp.TranslateException(exception3);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = this.InternalContainer.EndGetQueueStatistics(asyncResult);
            }
            catch (Exception exception4)
            {
                StorageStamp.TranslateException(exception4);
                throw;
            }
        }
Exemplo n.º 4
0
        private IEnumerator <IAsyncResult> ListMessagesImpl(string queueNameStart, DateTime?visibilityStart, Guid messageIdStart, int?subQueueId, bool includeInvisibleMessages, int numberOfMessages, AsyncIteratorContext <ListMessagesResult> context)
        {
            IAsyncResult  asyncResult;
            RemainingTime remainingTime = new RemainingTime(base.Timeout);

            try
            {
                this.InternalContainer.Timeout = StorageStampHelpers.AdjustTimeoutRange(remainingTime);
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            try
            {
                asyncResult = this.InternalContainer.BeginGetProperties(ContainerPropertyNames.None, null, context.GetResumeCallback(), context.GetResumeState("QueueContainer.ListMessagesImpl"));
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndGetProperties(asyncResult);
            }
            catch (Exception exception2)
            {
                StorageStamp.TranslateException(exception2);
                throw;
            }
            try
            {
                this.InternalContainer.Timeout = remainingTime;
                asyncResult = this.InternalContainer.BeginListMessages(queueNameStart, visibilityStart, messageIdStart, subQueueId, includeInvisibleMessages, numberOfMessages, context.GetResumeCallback(), context.GetResumeState("QueueContainer.ListMessagesImpl"));
            }
            catch (Exception exception3)
            {
                StorageStamp.TranslateException(exception3);
                throw;
            }
            yield return(asyncResult);

            try
            {
                context.ResultData = this.InternalContainer.EndListMessages(asyncResult);
            }
            catch (Exception exception4)
            {
                StorageStamp.TranslateException(exception4);
                throw;
            }
        }
Exemplo n.º 5
0
        private IEnumerator <IAsyncResult> ClearQueueImpl(AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult  asyncResult;
            RemainingTime remainingTime = new RemainingTime(base.Timeout);

            try
            {
                this.InternalContainer.Timeout = StorageStampHelpers.AdjustTimeoutRange(remainingTime);
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            try
            {
                asyncResult = this.InternalContainer.BeginGetProperties(ContainerPropertyNames.None, null, context.GetResumeCallback(), context.GetResumeState("QueueContainer.GetMessageImpl"));
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndGetProperties(asyncResult);
            }
            catch (Exception exception2)
            {
                StorageStamp.TranslateException(exception2);
                throw;
            }
            try
            {
                this.InternalContainer.Timeout = remainingTime;
                asyncResult = this.InternalContainer.BeginClearQueue(context.GetResumeCallback(), context.GetResumeState("QueueContainer.GetMessageImpl"));
            }
            catch (Exception exception3)
            {
                StorageStamp.TranslateException(exception3);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndClearQueue(asyncResult);
            }
            catch (Exception exception4)
            {
                StorageStamp.TranslateException(exception4);
                throw;
            }
        }