Safe Haskell | None |
---|
Common types and functions for persistent resources
In particular: - locks - temporary reservations
Synopsis
- data Persistent a = Persistent {
- persName :: String
- persPath :: IO FilePath
- persEmpty :: a
- persCleanup :: ClientId -> WConfdMonad ()
- writePersistentAsyncTask :: JSON a => Persistent a -> IO a -> ResultG (AsyncWorker () ())
- readPersistent :: JSON a => Persistent a -> ResultG a
- persistentLocks :: Persistent GanetiLockWaiting
- persistentTempRes :: Persistent TempResState
Common definitions
The data type that collects all required operations
data Persistent a Source #
A collection of operations needed for persisting a resource.
Persistent | |
|
Common functions
writePersistentAsyncTask :: JSON a => Persistent a -> IO a -> ResultG (AsyncWorker () ()) Source #
Construct an asynchronous worker whose action is to save the
current state of the persistent state.
The worker's action reads the state using the given IO
action. Any inbetween changes to the file are tacitly ignored.
readPersistent :: JSON a => Persistent a -> ResultG a Source #
Load a persistent data structure from disk.