Safe Haskell | None |
---|
- data Ev m t
- type AnyEv a = forall t. (Monad (t STM), MonadTrans t) => Ev (t STM) a
- data TxControl
- query :: (MonadIO m, QueryEvent ev res) => ev -> m res
- update :: (MonadIO m, UpdateEvent ev res) => ev -> m res
- type Update state = Ev (StateT state STM)
- type Query state = Ev (ReaderT state STM)
- type TxId = Int64
- type EpochMilli = Int64
- data Saver
- module Happstack.State.Monad
- getEventId :: Integral txId => AnyEv txId
- getTime :: Integral epochTime => AnyEv epochTime
- getEventClockTime :: AnyEv ClockTime
- getEventStream :: IO (IO EventItem)
- data EventItem = EventItem {
- eventContext :: TxContext
- eventData :: Dynamic
- module Happstack.State.Util
- module Happstack.Data.Serialize
- module Happstack.Data.SerializeTH
- module Happstack.State.Control
- module Happstack.State.ComponentTH
- module Happstack.State.ComponentSystem
- runTxSystem :: (Methods st, Component st) => Saver -> Proxy st -> IO (MVar TxControl)
- createCheckpoint :: MVar TxControl -> IO ()
- shutdownSystem :: MVar TxControl -> IO ()
- unsafeIOToEv :: IO a -> AnyEv a
ACID monad
Monad for ACID event handlers.
type AnyEv a = forall t. (Monad (t STM), MonadTrans t) => Ev (t STM) aSource
ACID computations that work with any state and event types.
query :: (MonadIO m, QueryEvent ev res) => ev -> m resSource
Emit a state query and wait for the result.
update :: (MonadIO m, UpdateEvent ev res) => ev -> m resSource
Schedule an update and wait for it to complete. When this function returns, you're guaranteed the update will be persistent.
Types
type EpochMilli = Int64Source
Misc utilities
module Happstack.State.Monad
getEventId :: Integral txId => AnyEv txIdSource
getEventStream :: IO (IO EventItem)Source
module Happstack.State.Util
Serialization
module Happstack.Data.Serialize
module Happstack.Data.SerializeTH
module Happstack.State.Control
module Happstack.State.ComponentTH
runTxSystem :: (Methods st, Component st) => Saver -> Proxy st -> IO (MVar TxControl)Source
Run the MACID system without multimaster support and with the given Saver.
createCheckpoint :: MVar TxControl -> IO ()Source
shutdownSystem :: MVar TxControl -> IO ()Source
Shuts down a transaction system
Unsafe things
unsafeIOToEv :: IO a -> AnyEv aSource