persistent-map-0.3.5: A thread-safe (STM) persistency interface for finite map types.Source codeContentsIndex
Data.TMap.Backend
Portabilitynon-portable (requires STM)
Stabilityexperimental
MaintainerPeter Robinson <thaldyron@gmail.com>
Description
Provides a type class for backends. To avoid data inconsistencies, these functions should not be used directly but only via the TMap interface.
Synopsis
class Ord k => Backend k a b | a -> k where
insert :: b k a -> k -> a -> IO ()
adjust :: b k a -> (a -> a) -> k -> IO ()
delete :: b k a -> k -> IO ()
lookup :: b k a -> k -> IO (Maybe a)
flush :: b k a -> IO ()
initialize :: b k a -> IO ()
Documentation
class Ord k => Backend k a b | a -> k whereSource
This class needs to be instantiated when developing a new backend. The backend is expected to be able to handle concurrent (non-conflicting) requests.
Methods
insert :: b k a -> k -> a -> IO ()Source
Called when a new element was inserted.
adjust :: b k a -> (a -> a) -> k -> IO ()Source
Called when an element was updated.
delete :: b k a -> k -> IO ()Source
Called when an element was deleted from the map.
lookup :: b k a -> k -> IO (Maybe a)Source
Called when an element is not found in the map.
flush :: b k a -> IO ()Source
Called by flushBackend and purgeTMap.
initialize :: b k a -> IO ()Source
Called in newTMapIO
show/hide Instances
Produced by Haddock version 2.4.2