Constructors
FileLoglogIdentifier :: LogKey objectlogCurrent :: MVar FHandlelogNextEntryId :: TVar EntryIdlogQueue :: TVar ([ByteString], [IO ()])logThreads :: [ThreadId]
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19
Moduleacid-state-0.16.1.4Haskell2010
A log is a stack of entries that supports efficient pushing of new entries and fetching of old. It can be considered an extendible array of entries.
FileLoglogIdentifier :: LogKey objectlogCurrent :: MVar FHandlelogNextEntryId :: TVar EntryIdlogQueue :: TVar ([ByteString], [IO ()])logThreads :: [ThreadId]LogKeylogDirectory :: FilePathlogPrefix :: StringlogSerialiser :: Serialiser objectlogArchiver :: ArchiverSchedule a new log entry. This call does not block. The given IO action runs once the object is durable. The IO action blocks the serialization of events so it should be swift.
The given IO action is executed once all previous entries are durable.
Read all durable entries younger than the given EntryId. Note that entries written during or after this call won't be included in the returned list.
Obliterate log entries younger than or equal to the EntryId. Very unsafe, can't be undone
Obliterate log entries as long as the filter function returns True.
Finds the newest entry in the log. Doesn't work on open logs. Do not use after the log has been opened.
Implementation:
Search the newest log files first.
Once a file containing at least one valid entry is found, return the last entry in that file.
Move all log files that do not contain entries equal or higher than the
given entryId into an Archive/ directory.