Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for onEvict (0.03 sec)

  1. internal/lru/lru.go

    func NewLRU[K comparable, V any](size int, onEvict EvictCallback[K, V], ttl time.Duration) *LRU[K, V] {
    	if size < 0 {
    		size = 0
    	}
    	if ttl <= 0 {
    		ttl = noEvictionTTL
    	}
    
    	res := LRU[K, V]{
    		ttl:       ttl,
    		size:      size,
    		evictList: NewList[K, V](),
    		items:     make(map[K]*Entry[K, V]),
    		onEvict:   onEvict,
    		done:      make(chan struct{}),
    	}
    
    	// initialize the buckets
    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