Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Management

The registry can delete individual states, clear all states, and resync a state after a file change

Deleting a State

delete removes a single state file from disk

Rust

reader.states().delete("job-1")?;

Python

reader.states.delete("job-1")
# or:
del reader.states["job-1"]

delete raises Error::NotFound in Rust and KeyError in Python when the state does not exist

Clearing All States

clear removes every state file in the state_dir

Rust

reader.states().clear()?;

Python

reader.states.clear()

clear() removes every state file in the state_dir. Use it with caution, there is no undo

Resyncing a State

resync updates a saved state’s file metadata to match the current file on disk. Use it after a file moves, grows, or is otherwise modified. The read position is clamped to the new file size so it never points past the end

Rust

reader.states().resync("job-1", &new_path)?;

Python

reader.states.resync("job-1", new_path)

See Resync for the full catch-resync-retry pattern