Skip to content

[idea] register callbacks with Config #45

@neurite

Description

@neurite

Config changed -> Notify interested parties -> For example, reload the client with new configuration.

Interface:

refresh()
autoRefresh(interval)
registerCallback(key, callbackWithNewValue)

Note PropertiesConfig and JsonConfig do not know the sources of the configs. So a good place for these methods may be on DefaultConfig:

DefaultConfig.create()
        .autoRefresh(1000)
        .registerCallback("key", newVal -> {});

Or registering the callback is better close to where the key is used?

A custom class wrapping the DefaultConfig instance for managing refresh and callbacks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions