Ejemplo n.º 1
0
        private IEnumerator <IAsyncResult> ClearQueueImpl(AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult = this.StorageManager.AsyncProcessor.BeginExecute((TimeSpan remaining) => {
                using (DevelopmentStorageDbDataContext dbContext = DevelopmentStorageDbDataContext.GetDbContext())
                {
                    Microsoft.WindowsAzure.DevelopmentStorage.Store.QueueContainer queueContainer = this.LoadQueueContainer(dbContext);
                    dbContext.ClearQueue(queueContainer.AccountName, queueContainer.QueueName);
                    this._queue = queueContainer;
                }
            }, this.Timeout, context.GetResumeCallback(), context.GetResumeState("DbQueueContainer.ClearQueue"));

            yield return(asyncResult);

            this.StorageManager.AsyncProcessor.EndExecute(asyncResult);
        }