private async void Process(MqttContent Content) { try { while (true) { MqttTopic Topic = await this.GetTopic(Content.Topic, true); Topic?.DataReported(Content); lock (this.queue) { if (this.queue.First == null) { this.processing = false; break; } else { Content = this.queue.First.Value; this.queue.RemoveFirst(); } } } } catch (Exception ex) { Log.Critical(ex); this.processing = false; } }
public async Task DataReceived(MqttContent Content) { MqttTopic Topic = await this.GetTopic(Content.Topic, true); Topic?.DataReported(Content); }