PixelWeaver v0.5.0 /server.src.pixelweaver.autosave
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) -> None

Called after any state change to schedule a debounced save.

#_debounce_save

python
async def _debounce_save(self) -> None

Wait for the debounce period, then save if still dirty.

#start

python
async def start(self) -> None

Start the auto-save background task (periodic interval saves).

#stop

python
async def stop(self) -> None

Stop the background task gracefully, saving any pending changes.

#_periodic_loop

python
async def _periodic_loop(self) -> None

Run periodic saves on a fixed interval.

#save_now

python
async def save_now(self) -> None

Flush all project state to disk immediately.

Search