Esempio n. 1
0
        public Task <MqttClientSubscribeResult[]> ReSubscribeAllAsync(CancellationToken cancellationToken = default)
        {
            var subscribers = _subsManager.AllTopics().Select(async topic =>
            {
                if (await _mqttPersisterConnection.TryConnectAsync(cancellationToken: cancellationToken))
                {
                    return(await OnSubscribesAsync(topic));
                }
                return(null);
            });

            return(Task.WhenAll(subscribers));
        }