Skip to content

Request for RemoveWithoutEvict API. #171

Open
@StLeoX

Description

@StLeoX

lru always calls onEvict once when Remove is called. In a case where the element that I want to remove is already processed, and the processing logic is different from onEvict, I want to simply remove the element RemoveWithoutEvict API, it may be written as follow:

 func (c *Cache[K, V]) RemoveWithoutEvict(key K) (present bool) {
     c.lock.Lock()
     present = c.lru.Remove(key)
     c.lock.Unlock()
     return
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions