Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Handles to save/load files across the hydra-node. We use a simple JSON encoding and two modes of operation to store things: Full and Incremental.
Synopsis
- data PersistenceException
- data Persistence a m = Persistence {}
- createPersistence :: (MonadIO m, MonadThrow m) => FilePath -> m (Persistence a m)
- data PersistenceIncremental a m = PersistenceIncremental {}
- createPersistenceIncremental :: forall a m. (MonadIO m, MonadThrow m, MonadSTM m, MonadThread m, MonadThrow (STM m)) => FilePath -> m (PersistenceIncremental a m)
Documentation
data PersistenceException Source #
Instances
Exception PersistenceException Source # | |
Show PersistenceException Source # | |
Defined in Hydra.Persistence | |
Eq PersistenceException Source # | |
Defined in Hydra.Persistence (==) :: PersistenceException -> PersistenceException -> Bool Source # (/=) :: PersistenceException -> PersistenceException -> Bool Source # |
data Persistence a m Source #
Handle to save and load files to/from disk using JSON encoding.
createPersistence :: (MonadIO m, MonadThrow m) => FilePath -> m (Persistence a m) Source #
Initialize persistence handle for given type a
at given file path.
data PersistenceIncremental a m Source #
Handle to save incrementally and load files to/from disk using JSON encoding.
createPersistenceIncremental :: forall a m. (MonadIO m, MonadThrow m, MonadSTM m, MonadThread m, MonadThrow (STM m)) => FilePath -> m (PersistenceIncremental a m) Source #
Initialize persistence handle for given type a
at given file path.
This instance of PersistenceIncremental
is "thread-safe" in the sense that
it prevents loading from a different thread once one starts $sel:append:PersistenceIncremental
ing
through the handle. If another thread attempts to $sel:loadAll:PersistenceIncremental
after this point,
an IncorrectAccessException
will be raised.