feat: implement Getbatch in rpcCache.

This commit is contained in:
Monet Lee
2024-09-05 18:47:54 +08:00
parent 7f8d26c36b
commit c667795285
4 changed files with 131 additions and 18 deletions
+1
View File
@@ -20,6 +20,7 @@ type EvictCallback[K comparable, V any] simplelru.EvictCallback[K, V]
type LRU[K comparable, V any] interface {
Get(key K, fetch func() (V, error)) (V, error)
GetBatch(key []K, fetchBatch func([]K) (map[string]V, error)) (map[string]V, error)
SetHas(key K, value V) bool
Del(key K) bool
Stop()