review: a memory write wakes the Honcho worker

A write, an undo or an accepted write decided into the ledger waited out the
worker's 30 s idle sleep. Mirror::journalled now says whether it added a line,
and memoryd wakes the worker when it did. The Wake lock is a leaf, taken under
the index lock as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-28 14:07:38 -07:00
co-authored by Claude Opus 5.5
parent 7c207f6ec6
commit 3dd95c5791
3 changed files with 153 additions and 9 deletions
+5 -2
View File
@@ -228,9 +228,12 @@ impl Memoryd {
/// With `[honcho]`: decide journalled edit `id` (the latest when `None`) into the ledger. Called
/// under the index lock, so edits are decided in the journal's order (M5c spec, section 4).
/// What it decided is sent at once: the worker is woken.
fn mirror(&self, id: Option<&str>) {
if let Some(mirror) = &self.mirror {
mirror.journalled(&self.store, id, Timestamp::now(), &*self.log);
if let Some(mirror) = &self.mirror
&& mirror.journalled(&self.store, id, Timestamp::now(), &*self.log)
{
self.wake.notify();
}
}