TCache-0.13.3: A Transactional cache with user-defined persistence
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.TCache.Triggers

Synopsis

Documentation

data DBRef a Source #

Constructors

DBRef !String !(TPVar a) 

Instances

Instances details
(IResource a, Typeable a) => Read (DBRef a) Source # 
Instance details

Defined in Data.TCache

Show (DBRef a) Source # 
Instance details

Defined in Data.TCache.Defs

Methods

showsPrec :: Int -> DBRef a -> ShowS #

show :: DBRef a -> String #

showList :: [DBRef a] -> ShowS #

Eq (DBRef a) Source # 
Instance details

Defined in Data.TCache.Defs

Methods

(==) :: DBRef a -> DBRef a -> Bool #

(/=) :: DBRef a -> DBRef a -> Bool #

Ord (DBRef a) Source # 
Instance details

Defined in Data.TCache.Defs

Methods

compare :: DBRef a -> DBRef a -> Ordering #

(<) :: DBRef a -> DBRef a -> Bool #

(<=) :: DBRef a -> DBRef a -> Bool #

(>) :: DBRef a -> DBRef a -> Bool #

(>=) :: DBRef a -> DBRef a -> Bool #

max :: DBRef a -> DBRef a -> DBRef a #

min :: DBRef a -> DBRef a -> DBRef a #

data Elem a Source #

Constructors

Elem !a !AccessTime !ModifTime 

data Status a Source #

Constructors

NotRead 
DoNotExist 
Exist a 

addTrigger :: (IResource a, Typeable a) => (DBRef a -> Maybe a -> STM ()) -> IO () Source #

Add an user defined trigger to the list of triggers Trriggers are called just before an object of the given type is created, modified or deleted. The DBRef to the object and the new value is passed to the trigger. The called trigger function has two parameters: the DBRef being accesed (which still contains the old value), and the new value. If the DBRef is being deleted, the second parameter is Nothing. if the DBRef contains Nothing, then the object is being created

applyTriggers :: (IResource a, Typeable a) => [DBRef a] -> [Maybe a] -> STM () Source #

internally called when a DBRef is modifieddeletedcreated