Commit Graph
7 Commits
Author SHA1 Message Date
rosstimothy 5f2bd1cb47 Tweak sortcache.SortCache API (#52414)
- Adds (SortCache) Clear to allow resetting an existing cache
- Converts (SortCache) Ascend and (SortCache) Descend to return
  an iter.Seq[T] instead of taking an iteration function
- Removes (SortCache) AscendPaginated and (SortCache) DescendPaginated

Leveraging iterates aligns the API with the direction that Go is
heading in regards to iteration. Removing of the paginated functions
does put the onus on callers to paginate, however, in the only
cases these were used there are now fewer allocations. AscendPaginated
was unused and DescendPaginated was only used in two places - both
of which would benefit from migrating away from using streams in
favor of iter.Seq.

The new Clear API makes it easier for callers to reset an existing
cache. Without this change the only way to reset a cache would be
to replace the entire cache with a new one. This places the burden
on callers to apply locking and handle concurrent read/write/deletes
and swapping out the cache entirely. That all is eliminated by
Clear handling the internal locking to reset the cache state.
2025-02-25 17:56:54 +00:00
Forrest c2a298b7bb fix access request cache panic (#44790) 2024-08-07 16:04:46 +00:00
Forrest de63b027ac fix access request cache test race (#44528) 2024-07-24 16:20:10 +00:00
Forrest c320c5a89f improve unified resource cache perf (#42892) 2024-06-13 18:56:17 +00:00
Forrest 14605bafab filter expired requests from cache reads (#40858) 2024-04-26 18:24:38 +00:00
Michael aeed30d33c Use new access request filters in webUI (#39625) 2024-03-27 18:21:55 +00:00
Forrest e4330b1db2 pagination & sorting for access requests (#38633) 2024-02-29 22:09:43 +00:00