DeleteQueueIfExistsAsync() public static method

public static DeleteQueueIfExistsAsync ( string connectionString, string path ) : System.Threading.Tasks.Task
connectionString string
path string
return System.Threading.Tasks.Task
        public async Task Close(TimeSpan timespan)
        {
            // Pause the processing threads
            this.pauseProcessingEvent.Reset();

            // There is no clean approach to wait for the threads to complete processing.
            //  We simply stop any new processing, wait for existing thread to complete, then close the message pump and then return
            Thread.Sleep(timespan);

            this.inQueue.Close();

            // Cleanup resources.
            await ServiceBusUtilities.DeleteQueueIfExistsAsync(Settings.ServiceBusConnectionString, this.inQueue.Path);
        }
Esempio n. 2
0
        public async Task Stop(TimeSpan?waitTime)
        {
            if (waitTime.HasValue)
            {
                // Pause the processing threads on the message pump.
                this.pauseProcessingEvent.Reset();

                // There is no clean approach to wait for the threads to complete processing.
                // We simply stop any new processing, wait for existing thread to complete, then close the message pump and then return
                Thread.Sleep(waitTime.Value);
            }

            await this.client.CloseAsync();

            await ServiceBusUtilities.DeleteQueueIfExistsAsync(this.connectionString, this.queueName);
        }