1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

ConfigServer+LibConfig: Add way for clients to listen for config changes

This patch adds a Config::Listener abstract class that anyone can
inherit from and receive notifications when configuration values change.

We don't yet monitor file system changes, so these only work for changes
made by ConfigServer itself.

In order to receive these notifications, clients must monitor the domain
by calling monitor_domain(). Only pledged domains can be monitored.

Note that the client initiating the change does not get notified.
This commit is contained in:
Andreas Kling 2021-08-26 19:05:50 +02:00
parent 9509f2ff87
commit edf7843409
9 changed files with 188 additions and 15 deletions

View file

@ -2,6 +2,8 @@ endpoint ConfigServer
{
pledge_domains(Vector<String> domains) =|
monitor_domain(String domain) =|
read_string_value(String domain, String group, String key) => (Optional<String> value)
read_i32_value(String domain, String group, String key) => (Optional<i32> value)
read_bool_value(String domain, String group, String key) => (Optional<bool> value)