Skip to content

Conversation

@ionutab
Copy link
Contributor

@ionutab ionutab commented Nov 16, 2025

Hello,

There's a limitation caused by the use of select in the paho.mqtt.python library.

eclipse-paho/paho.mqtt.python#697

The purpose of this PR is to provide an implementation of MqttClient that has an overriden _loop method that uses selectors instead of select.

The implementation was initially posted on the solution above, by @j04n-f

Please advise on:
🤔 I'm not sure about the Experimental name.
📌 Code placement in a separate file.
🧀 If any specific tests are desired and or necessary.
🩻 What better example I could provide.

After the implementation is confirmed I will add documentation and README file updates.

Thanks!

@ionutab ionutab changed the title adding experimental mqtt user that works around the paho mqtt 340 connections issue adding experimental mqtt user that works around the paho mqtt 340 connections limit issue Nov 16, 2025
@cyberw
Copy link
Collaborator

cyberw commented Nov 16, 2025

Code placement in a separate file.

Maybe make it a flag in MqttUser instead (passed on to MqttClient triggering a replace of the _loop method in its constructor)? If this is a good fix, maybe it should even be the default?

Perhaps we should log a warning if someone tries to launch >340 connections with the default setup?

@ionutab
Copy link
Contributor Author

ionutab commented Nov 17, 2025

Good ideas. I'll see what I can do. Thanks!

@ionutab ionutab force-pushed the feature/mqtt_experimental branch from 4ebb94b to 879b84c Compare November 25, 2025 21:19
@ionutab ionutab changed the title adding experimental mqtt user that works around the paho mqtt 340 connections limit issue adding mqtt user feature that works around the paho mqtt 340 connections limit issue Nov 25, 2025
@ionutab
Copy link
Contributor Author

ionutab commented Nov 26, 2025

I've made the update.
Need to test it.

I'm not sure where to add the validation for the 340 warning message.
Is it in the start method in the runners.py file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants