Meridio icon indicating copy to clipboard operation
Meridio copied to clipboard

Add cache to watch function

Open LionelJouin opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. Currently the watch function always send data to the client even if no changes happened in the retuned list. For instance, the configmap (with trench, conduit, stream...) has been modified with a new attractor, and a client was watching the streams in the trench, the list of streams will be sent again due to this attractor event (which had no effect on the list of streams).

Describe the solution you'd like The last list that have been sent can be hashed and stored, and when a new list is about to be sent, a comparaison can be done to avoid sending the same list (containing exactly the same properties) several times.

Describe alternatives you've considered /

Additional context https://github.com/Nordix/Meridio/blob/v0.8.0/pkg/configuration/manager/watcher.go#L203 https://github.com/Nordix/Meridio/blob/v0.8.0/pkg/ambassador/tap/stream/registry/watcher.go#L70

LionelJouin avatar Sep 23 '22 07:09 LionelJouin