Package twisted :: Package persisted :: Package journal :: Module base :: Class Journal |
[show private | hide private]
[frames | no frames]

## Class Journal

Known Subclasses:
  `MemoryJournal`, `RowJournal`

All commands to the system get routed through here.

Subclasses should implement the actual snapshotting capability.

Method Summary
| `__init__(self, log, journaledService)`
| ``executeCommand`(self, command)` Log and execute a command.
| ``getLastSnapshot`(self)` Return command index of the last snapshot taken.
| ``sync`(self, *args, **kwargs)` Save journal to disk, returns Deferred of finish status.
| ``updateFromLog`(self)` Run all commands from log that haven't been run yet.
| ``_reallyExecute`(self, index, command, runTime)` Callback called when logging command is done.

Method Details

### executeCommand(self, command) Log and execute a command.

### getLastSnapshot(self) Return command index of the last snapshot taken.

### sync(self, *args, **kwargs) Save journal to disk, returns Deferred of finish status. Subclasses may choose whatever signature is appropriate, or may not implement this at all.

### updateFromLog(self) Run all commands from log that haven't been run yet. This method should be run on startup to ensure the snapshot is up-to-date.

### _reallyExecute(self, index, command, runTime) Callback called when logging command is done.

Generated by Epydoc 1.1 on Thu May 8 13:18:35 2003 | http://epydoc.sf.net