ConfigStore¶
ConfigStore for runtime configuration management.
Provides thread-safe access to configuration with support for dynamic updates and change subscriptions.
- class varlord.store.ConfigDiff(added, modified, deleted)[source]¶
Bases:
objectRepresents changes between two configuration snapshots.
- __init__(added, modified, deleted)¶
- class varlord.store.ConfigStore(resolver, model)[source]¶
Bases:
objectThread-safe configuration store with dynamic update support.
Provides: - Atomic configuration snapshots - Thread-safe get() and attribute access - Change subscriptions - Automatic validation on updates
- __init__(resolver, model)[source]¶
Initialize ConfigStore.
- Parameters:
Note
Watch is automatically enabled if any source supports it.
- get()[source]¶
Get current configuration (thread-safe).
- Returns:
Current model instance
- Return type:
- subscribe(callback)[source]¶
Subscribe to configuration changes.
- Parameters:
callback (Callable[[Any, ConfigDiff], None]) – Function called with (new_config, diff) on changes
Note
Callbacks are called when: - Configuration changes are detected via watch (if any source supports it) - Manual reload() is called and configuration has changed
If no sources support watch, callbacks will only be called on manual reload().