mealstrom-0.0.0.1: Manipulate FSMs and store them in PostgreSQL.

Copyright(c) Max Amanshauser 2016
LicenseMIT
Maintainermax@lambdalifting.org
Safe HaskellNone
LanguageHaskell2010

Mealstrom.MemoryStore

Description

 

Synopsis

Documentation

data MemoryStore k s e a Source #

Instances

WALStore (MemoryStore k s e a) k Source # 

Methods

walUpsertIncrement :: MemoryStore k s e a -> k -> IO () Source #

walDecrement :: MemoryStore k s e a -> k -> IO () Source #

walScan :: MemoryStore k s e a -> Int -> IO [WALEntry k] Source #

MealyInstance k s e a => FSMStore (MemoryStore k s e a) k s e a Source # 

Methods

fsmRead :: MemoryStore k s e a -> k -> Proxy k s e a -> IO (Maybe s) Source #

fsmCreate :: MemoryStore k s e a -> Instance k s e a -> IO (Maybe String) Source #

fsmUpdate :: MemoryStore k s e a -> k -> MachineTransformer s e a -> IO MealyStatus Source #

mkStore :: MealyInstance k s e a => Text -> IO (MemoryStore k s e a) Source #

_fsmRead :: MemoryStore k s e a -> k -> STM (Maybe (Instance k s e a)) Source #

_fsmCreate :: MemoryStore k s e a -> Instance k s e a -> STM (Maybe String) Source #

For compatibility with the other stores we check existence here

_fsmUpdate :: MemoryStore k s e a -> k -> MachineTransformer s e a -> IO MealyStatus Source #

We need to use a lock here, because we are in the unfortunate position of having to use IO while performing STM operations, which is not possible. Using the lock we can rest assured no concurrent update operation can progress.

printWal :: MemoryStore k s e a -> k -> IO () Source #