Disk cache: apply the free-space reading where it's taken, evict off the UI thread at open (#2551)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
arnav-hiwarkar
2026-10-28 22:45:48 +05:30
co-authored by Claude Opus 5.5
parent 74ea0be88f
commit 8ab492d8cd
3 changed files with 31 additions and 8 deletions
+3 -2
View File
@@ -44,8 +44,9 @@ impl<T> Default for Watch<T> {
/// The system's memory ([`memory`]).
pub type MemoryWatch = Watch<SysMemory>;
/// The disk cache's disk: `(total, available)` bytes ([`disk_space`]).
pub type DiskWatch = Watch<(u64, u64)>;
/// The disk cache's free-space reading ([`disk_space`]): the reader applies it to its cache
/// itself, so only the busy guard is used.
pub type DiskWatch = Watch<()>;
impl<T: Copy + Send + 'static> Watch<T> {
/// Start a new reading in the background on a thread called `name` (no threads on the web: