public async Task UnsubscribeAsync(string subject, string queue, INatsMessageListener listener)
        {
            CheckOpen();

            NatsSubscription deletedSubscription = null;

            lock (_lock)
            {
                // Find subscription
                for (var index = 0; index < _subscriptions.Count; index++)
                {
                    var subscription = _subscriptions[index];
                    if (subscription.Subject == subject && subscription.Queue == queue && subscription.Listener == listener)
                    {
                        deletedSubscription = subscription;
                        _subscriptions.RemoveAt(index);
                        break;
                    }
                }
            }

            // Unsubscribe if there are no more subscriptions
            if (deletedSubscription != null)
            {
                deletedSubscription.Handler.Unsubscribe();
            }

            await Task.Delay(0);
        }
        public async Task SubscribeAsync(string subject, string queue, INatsMessageListener listener)
        {
            CheckOpen();

            // Subscribe to the topic
            // Todo: Shall we skip if similar subscription already exist?
            var handler = _connection.SubscribeAsync(subject, queue, listener.OnMessage);

            lock (_lock)
            {
                // Add subscription to the list
                var subscription = new NatsSubscription
                {
                    Subject  = subject,
                    Listener = listener,
                    Queue    = queue,
                    Handler  = handler
                };
                _subscriptions.Add(subscription);
            }

            await Task.Delay(0);
        }