-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rest] Add caching for TagResource & De-duplicate code for caching #3729
Conversation
Signed-off-by: Florian Hotze <[email protected]>
Would it be also possible to emit a change event or is this out of scope? |
From my POV it's out of scope of this PR, in general it's up to the core maintainers to decide whether to merge such a PR, just ask them. |
Regarding this PR: Fine with me, however I would prefer to have the Regarding the event: I don't think there is a good argument against having an event for "tags changed". If someone provides a PR for that, I would be willing to review and merge. I guess the event type needs to be defined and the registry needs to be enhanced so that it gets a reference to the |
This new class allows to add execute a Runnable on any type of change to the registry Signed-off-by: Florian Hotze <[email protected]>
Finished! I created a |
Signed-off-by: Florian Hotze <[email protected]>
...e.io.rest.core/src/main/java/org/openhab/core/io/rest/core/internal/thing/ThingResource.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Florian Hotze <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This implements caching for GET
/rest/tags
and GET/rest/tags/:tagname
as in #3335 and de-duplicates RegistryChangeListener code used by nearly all cached REST resources by introducing theRegistryChangedRunnableListener
class.