Switch to an event based architecture #1469
Replies: 4 comments
-
|
Thanks for the proposal. I'm always interested in considering ways to improve the system. Could you help me understand a bit more with an example of how and where this would be used in Mycodo? |
Beta Was this translation helpful? Give feedback.
-
|
This would allow for an asynchronous yet very low-latency communication between modules (e.g. Reactive Pattern). No one needs polling, everyone has a messagehandler that is called when a certain condition is met (there are also patterns if mutliple input data or criteria are needed). This makes each participant rather simple in interface and also testable … Think of every object having ‘onMessage’ Handlers like in mqtt that are called whenever something relevant for the object is happening. This could be either tightly integrated with something like mqtt or can be achieved solely within python e.g. with RxPY or some other framework(s) … P.S.: This would also allow a pattern that in Zigbee is called ‘binding’ that makes an input directly trigger an output without any controller e.g. for a simple switch on/off operation |
Beta Was this translation helpful? Give feedback.
-
|
example for a mqtt based event-driven architecture: https://brewblox.netlify.app/ |
Beta Was this translation helpful? Give feedback.
-
|
Long time no see, because I switched to homeassistant for all of my automation projects (growtent, solar, ev, …). But I still miss the PIDs in mycodo … |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know it is a heavyweight task, but I guess the platform would in the long term benefit from an event-based architecture replacing the timer/pull based architecture it uses now.
Advantages I see:
Disadvantages I see:
What d‘you think?
Beta Was this translation helpful? Give feedback.
All reactions