legion-extra-0.1.2.0: Extra non-essential utilities for building legion applications.

Safe HaskellNone
LanguageHaskell2010

Network.Legion.Persistence

Description

This module contains some basis persistence strategies useful for testing, or getting started.

Synopsis

Documentation

newMemoryPersistence :: IO (Persistence e o s) Source #

A convenient memory-based persistence layer. Good for testing or for applications (like caches) that don't have durability requirements.

diskPersistence Source #

Arguments

:: (Binary e, Binary s) 
=> FilePath

The directory under which partition states will be stored.

-> (Peer -> ClusterPowerState -> IO ())

A user-supplied mechanism to for saving the cluster state, for recovery purposes.

-> Persistence e o s 

A convenient way to persist partition states to disk. This persistence implementation is very simplistic, and may not be suitable for all uses.