AppendLogType

PackageAxial.Files
A bounded framed file log retaining two generations. Dispose the resource before opening another writer.

Specification

Kind
Type
Members
3
Examples
0
openLogSignature
AppendLog.openLog path maxBytes
appendSignature
AppendLog.append record log
readAllSignature
AppendLog.readAll log

Summary

NameSignatureSynopsis
Operations
openLogAppendLog.openLog path maxBytesOpens a log, preserving the rotated generation when the current file is missing, and truncates a corrupt tail.
appendAppendLog.append record logSerialises appends and flushes record contents to storage before acknowledgement.
readAllAppendLog.readAll logReplays valid frames from the current file.

Operations

kind:member

openLog

AppendLog.openLog path maxBytes
Member
Opens a log, preserving the rotated generation when the current file is missing, and truncates a corrupt tail. Frame lengths are bounded by maxBytes.

Parameters

NameTypeDescription
pathstring
maxBytesint64

Returns

Resource<'env, FileSystemError, AppendLog>
kind:member

append

AppendLog.append record log
Member
Serialises appends and flushes record contents to storage before acknowledgement. Rotation retains two generations; directory entries are not fsynced for power-loss durability.

Parameters

NameTypeDescription
recordbyte array
logAppendLog

Returns

Flow<'env, FileSystemError, unit>
kind:member

readAll

AppendLog.readAll log
Member
Replays valid frames from the current file.

Parameters

NameTypeDescription
logAppendLog

Returns

FlowStream<'env, FileSystemError, byte array>