/// <summary> /// Adds the client to the queue /// </summary> public async Task <QueueSubscriptionResult> AddClient(MqClient client) { foreach (IQueueAuthenticator authenticator in Server.QueueAuthenticators) { bool allowed = await authenticator.Authenticate(this, client); if (!allowed) { return(QueueSubscriptionResult.Unauthorized); } } if (Options.ClientLimit > 0 && _clients.Count >= Options.ClientLimit) { return(QueueSubscriptionResult.Full); } QueueClient cc = new QueueClient(this, client); _clients.Add(cc); client.AddSubscription(cc); foreach (IQueueEventHandler handler in Server.QueueEventHandlers) { await handler.OnConsumerSubscribed(cc); } _ = Trigger(); OnConsumerSubscribed.Trigger(cc); return(QueueSubscriptionResult.Success); }