temporal
temporal copied to clipboard
Dynamic config change listener
Is your feature request related to a problem? Please describe. Existing dynamic config is built as poll model, meaning when a value is needed, a function call needs to be made to get the latest value.
This poll model works well for values that are accessed frequently, but not for values that are rarely accessed or even accessed only once. For example, configs that are used only at service start time, like task worker pool size.
In those cases, either the config updates are completely ignored when the service is running or each component needs to have its own poller to periodically check if the config value is updated or not (e.g. https://github.com/temporalio/temporal/pull/2911). For values that are rarely updated, it is not efficient and also causes a lot of duplicated code for polling value updates.
Describe the solution you'd like Add support for push model in dynamic config so that a listener can be registered for a certain key.
Describe alternatives you've considered
Additional context