Module journal
Expand description
Session journal: async file writer and replay.
The journal stores raw bytes produced by JournaledSession::take_journal.
On startup the file is replayed to reconstruct an InMemorySession;
during operation new bytes are appended and fsynced after each event-loop
iteration.
ยงFile format
file = header ops*
header = magic(4) version(1)
magic = 0x46 0x4D 0x51 0x4A ("FMQJ")
version = 0x01
ops = <raw bytes from JournaledSession>Structsยง
- Writer
- Appends journal bytes to a file.
Constantsยง
- HEADER_
LEN ๐ - MAGIC ๐
- VERSION ๐
Functionsยง
- decode_
error_ ๐to_ io - replay
- Read a journal file and reconstruct an
InMemorySession.