peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
566 stars 121 forks source link

RFC The main branch #152

Open peterhinch opened 1 week ago

peterhinch commented 1 week ago

@bobveringa I hope you had an enjoyable break.

I have given some thought to the changes on the read_allocate branch. I think, once you've ironed out any issues in your application, these should be merged. These are the main considerations.

Re refactoring, I suggest you watch this short video by Damien George on MicroPython optimisation. This will explain why MicroPython code tends to differ from "big iron" Python, notably in object naming. My main concern is __init__.py because of the use of V3.1.1 on ESP8266, which is extremely RAM-constrained. You might also want to consider these issues in mqtt_v5_properties.py.

Like all optimistion, this may be done late, once we have a solution that meets your needs.

bobveringa commented 1 week ago

This looks like a clear approach.

Once I have some more time I can investigate this refactoring issue.

peterhinch commented 1 week ago

I am happy to do the refactoring of __init__.py - I have quite a lot of experience with MP coding. The main issues are object names and cacheing of variables. The video will clarify the reasoning.

Talk next week :)