Пример #1
0
        private void BuildAndRegisterSubscription(SubscriptionOptions options, ServiceBusOptions parentOptions)
        {
            var subscription = new SubscriptionWrapper(options, parentOptions, _provider);

            subscription.Initialize();

            _registry.Register(subscription);
        }
Пример #2
0
        private async Task CloseSubscriptionAsync(SubscriptionWrapper subscription)
        {
            if (subscription.SubscriptionClient.IsClosedOrClosing)
            {
                return;
            }

            try
            {
                await subscription.SubscriptionClient.CloseAsync();
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"Closing of subscription Client {subscription.Name} failed");
            }
        }
Пример #3
0
 internal void Register(SubscriptionWrapper subscription)
 {
     _subscriptions.Add(subscription.Name, subscription);
 }