Hello..
I have developed a flutter application that uses StreamController to send messages to other class which is listening to them.
The definition is:
final StreamController<ReceivedMqttMessage> _messageController =
StreamController<ReceivedMqttMessage>.broadcast();
Stream<ReceivedMqttMessage> get messages => _messageController.stream;
When I need to send a message, I run this code:
_messageController.add(ReceivedMqttMessage(msg.topic!, payload));
After several calls, suddenly, CPU utilization grows up to 100%.
I cannot debug such a fact because all occurs asynchronously. Is there a way to use another mecanism to send message to other class?
When CPU is at 100% I cannot even use CPU profiler because application get stuck when that happens.
I use VSCode to develop.
Thanks
Jaime