Portability | non-portable (uses GHC extensions) |
---|---|
Maintainer | lemmih@gmail.com |
Safe Haskell | Safe-Infered |
AcidState container using a transaction log on disk. The term 'Event' is loosely used for transactions with ACID guarantees. 'Method' is loosely used for state operations without ACID guarantees (see Data.Acid.Core).
- openLocalState :: (Typeable st, IsAcidic st) => st -> IO (AcidState st)
- openLocalStateFrom :: IsAcidic st => FilePath -> st -> IO (AcidState st)
- createArchive :: AcidState st -> IO ()
- createCheckpointAndClose :: SafeCopy st => AcidState st -> IO ()
Documentation
:: (Typeable st, IsAcidic st) | |
=> st | Initial state value. This value is only used if no checkpoint is found. |
-> IO (AcidState st) |
Create an AcidState given an initial value.
This will create or resume a log found in the "state/[typeOf state]/" directory.
:: IsAcidic st | |
=> FilePath | Location of the checkpoint and transaction files. |
-> st | Initial state value. This value is only used if no checkpoint is found. |
-> IO (AcidState st) |
Create an AcidState given a log directory and an initial value.
This will create or resume a log found in directory
.
Running two AcidState's from the same directory is an error
but will not result in dataloss.
createArchive :: AcidState st -> IO ()Source
Move all log files that are no longer necessary for state restoration into the Archive
folder in the state directory. This folder can then be backed up or thrown out as you see fit.
Reverting to a state before the last checkpoint will not be possible if the Archive
folder
has been thrown out.
This method is idempotent and does not block the normal operation of the AcidState.