evict

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package evict holds the one generic map-eviction rule two packages need on opposite sides of a layering boundary: internal/server's captureStore and internal/reader's WriteLog each cap a map at a size limit by dropping its single oldest entry per insert. internal/reader must never import internal/server (the dependency runs the other way), so the shared rule lives here instead, importing nothing internal itself — the same shape as internal/boundedwait.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Oldest

func Oldest[K comparable, V any](m map[K]V, limit int, at func(V) time.Time)

Oldest deletes the oldest entry from m once it holds more than limit entries, using at to read each entry's timestamp for comparison.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL