Class ReactiveConfigValue<T>
java.lang.Object
cloud.opencode.base.config.jdk25.ReactiveConfigValue<T>
- Type Parameters:
T- value type | 值类型Security | 安全性:
- Thread-safe: Yes - 线程安全: 是
- Null-safe: No - 空值安全: 否
Reactive Configuration Value
响应式配置值
Provides automatic update notification when configuration values change. Uses virtual threads for subscriber notification.
当配置值变化时提供自动更新通知。使用虚拟线程进行订阅者通知。
Features | 主要功能:
- Automatic value updates - 自动值更新
- Subscriber notification - 订阅者通知
- Virtual thread execution - 虚拟线程执行
- Type-safe access - 类型安全访问
Usage Examples | 使用示例:
ReactiveConfigValue<String> logLevel = ReactiveConfigValue
.of(config, "log.level", String.class, "INFO")
.subscribe(level -> updateLogLevel(level));
// Current value
String current = logLevel.get();
// Unsubscribe
logLevel.unsubscribe(subscriber);
- Since:
- JDK 25, opencode-base-config V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()static <T> ReactiveConfigValue<T> voidunsubscribe(Consumer<T> subscriber)
-
Constructor Details
-
ReactiveConfigValue
-
-
Method Details
-
get
-
subscribe
-
unsubscribe
-
of
public static <T> ReactiveConfigValue<T> of(Config config, String key, Class<T> type, T defaultValue)
-