Beispiel #1
0
        /// <inheritdoc />
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Receiver.CloseAsync().ConfigureAwait(false).GetAwaiter().GetResult();
                Sender.CloseAsync().ConfigureAwait(false).GetAwaiter().GetResult();

                ReadTimer?.Dispose();
            }

            base.Dispose(disposing);
        }
Beispiel #2
0
        /// <inheritdoc />
        protected override async Task RebuildReceiver()
        {
            using (await ReceiverLock.WriterLockAsync())
            {
                if (Receiver != null && !Receiver.IsClosedOrClosing)
                {
                    await Receiver.CloseAsync().ConfigureAwait(false);
                }

                Receiver = new MessageReceiver(ConnectionString, AzureQueue.Name, ReceiveMode.PeekLock, new RetryExponential(TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(500), 3), BatchSize);
            }
        }