Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        public async Task DataReceived(MqttContent Content)
        {
            MqttTopic Topic = await this.GetTopic(Content.Topic, true);

            Topic?.DataReported(Content);
        }