Skip to content

Change callbacks #48

@pljakobs

Description

@pljakobs

I've been thinking about callbacks a bit more.

So far, we've discussed callbacks on streaming the data, I think there might be another classe which is callback on change.

The way I understood your suggestion on streaming is that I would be able to modify the data in motion - encrypting or decrypting it. That's cool for masquerading / encrypting fields.

If we had callbacks on change, we could essentially make the whole configuration event driven.

Let's take the example of {"network":{"connection":{}}}

If I could just subscribe to either the whole connection or to sub-items thereof, I could handle the whole reconfiguration in that callback.
I would also be able to take the change set and send it out to all possibly connected frontends (if a user had more than one connected) and other controllers (for global settings such as scenes)

The challenge I see with that is: how to determine the change set? The frontend may send any granularity of data, from the whole database json to a single property, in order to reconfigure the network, though, you'd want to wait until address, netmask and gateway are consistent - which may or may not involve a change to all of them. Maybe that's really for the callback to figure out and do some basic sanity testing on, or alternatively, the front end must take care of this to make sure that it sends the whole connection object as one update

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions