Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for EvictCallback (0.04 sec)

  1. internal/lru/lru.go

    import (
    	"sync"
    	"time"
    )
    
    // EvictCallback is used to get a callback when a cache entry is evicted
    type EvictCallback[K comparable, V any] func(key K, value V)
    
    // LRU implements a thread-safe LRU with expirable entries.
    type LRU[K comparable, V any] struct {
    	size      int
    	evictList *LruList[K, V]
    	items     map[K]*Entry[K, V]
    	onEvict   EvictCallback[K, V]
    
    	// expirable options
    	mu   sync.Mutex
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Fri Apr 25 08:22:26 UTC 2025
    - 12.5K bytes
    - Viewed (0)
Back to top