api: Add all in-flight requests /reverse_proxy/upstreams (#7277)

This commit is contained in:
Y.Horie 2025-09-30 22:52:28 +09:00
parent 65e0ddc221
commit aa1af53b86
4 changed files with 79 additions and 11 deletions

View file

@ -194,6 +194,16 @@ func (up *UsagePool) Delete(key any) (deleted bool, err error) {
return deleted, err
}
func (up *UsagePool) Load(key any) any {
up.RLock()
defer up.RUnlock()
upv, loaded := up.pool[key]
if loaded {
return upv.value
}
return nil
}
// References returns the number of references (count of usages) to a
// key in the pool, and true if the key exists, or false otherwise.
func (up *UsagePool) References(key any) (int, bool) {