Updated
On this page
Auto-save: periodic flush of in-memory state to disk.
#server.src.pixelweaver.autosave
#server.src.pixelweaver.autosave
Auto-save: periodic flush of in-memory state to disk.
The auto-saver runs as an asyncio background task. State is saved when: - A debounce timer expires after the last state mutation, OR - A fixed interval elapses since the last save
Whichever fires first triggers a save, preventing both data loss and excessive I/O.
#AutoSaver
Periodically flushes server state to disk.
#mark_dirty
python
def mark_dirty(self) -> NoneCalled after any state change to schedule a debounced save.
#_debounce_save
python
async def _debounce_save(self) -> NoneWait for the debounce period, then save if still dirty.
#start
python
async def start(self) -> NoneStart the auto-save background task (periodic interval saves).
#stop
python
async def stop(self) -> NoneStop the background task gracefully, saving any pending changes.
#_periodic_loop
python
async def _periodic_loop(self) -> NoneRun periodic saves on a fixed interval.
#save_now
python
async def save_now(self) -> NoneFlush all project state to disk immediately.