| Overloads | |
|---|---|
| GetMany(IEnumerable<string>) | 批量获取多个配置值,减少锁竞争 |
| GetMany(IEnumerable<string>, Action<string,string>) | 高性能批量获取:通过回调方式返回结果,零堆分配 |
| GetMany<T>(IEnumerable<string>) | 批量获取多个配置值并转换为指定类型 |
| GetMany<T>(IEnumerable<string>, Action<string,T>) | 高性能批量获取:通过回调方式返回结果并转换类型,零堆分配 |
批量获取多个配置值,减少锁竞争
System.Collections.Generic.IReadOnlyDictionary<string,string?> GetMany(System.Collections.Generic.IEnumerable<string> keys);
keys System.Collections.Generic.IEnumerable<System.String>
要获取的键集合
System.Collections.Generic.IReadOnlyDictionary<System.String,System.String>
键值对字典
高性能批量获取:通过回调方式返回结果,零堆分配
void GetMany(System.Collections.Generic.IEnumerable<string> keys, System.Action<string,string?> onValue);
keys System.Collections.Generic.IEnumerable<System.String>
要获取的键集合
onValue System.Action<System.String,System.String>
每个键值对的回调处理函数
此方法避免了 Dictionary 分配开销,适合高频调用场景。 回调会按键的顺序依次调用。
批量获取多个配置值并转换为指定类型
System.Collections.Generic.IReadOnlyDictionary<string,T?> GetMany<T>(System.Collections.Generic.IEnumerable<string> keys);
T
目标类型
keys System.Collections.Generic.IEnumerable<System.String>
要获取的键集合
System.Collections.Generic.IReadOnlyDictionary<System.String,T>
键值对字典
高性能批量获取:通过回调方式返回结果并转换类型,零堆分配
void GetMany<T>(System.Collections.Generic.IEnumerable<string> keys, System.Action<string,T?> onValue);
T
目标类型
keys System.Collections.Generic.IEnumerable<System.String>
要获取的键集合
onValue System.Action<System.String,T>
每个键值对的回调处理函数
此方法避免了 Dictionary 分配开销,适合高频调用场景。 回调会按键的顺序依次调用。