Copyright | (c) Max Amanshauser 2016 |
---|---|
License | MIT |
Maintainer | max@lambdalifting.org |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data MemoryStore k s e a
- mkStore :: MealyInstance k s e a => Text -> IO (MemoryStore k s e a)
- _fsmRead :: MemoryStore k s e a -> k -> STM (Maybe (Instance k s e a))
- _fsmCreate :: MemoryStore k s e a -> Instance k s e a -> STM (Maybe String)
- _fsmUpdate :: MemoryStore k s e a -> k -> MachineTransformer s e a -> IO MealyStatus
- printWal :: MemoryStore k s e a -> k -> IO ()
Documentation
data MemoryStore k s e a Source #
Instances
WALStore (MemoryStore k s e a) k Source # | |
Defined in Mealstrom.MemoryStore 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 # | |
Defined in Mealstrom.MemoryStore 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 #
_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 #