happstack-state 0.5.0.3 → 0.5.0.4
raw patch · 3 files changed
+9/−7 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Happstack.State.Transaction: instance [overlap ok] (Typeable st) => QueryEvent (GetState st) ByteString
- Happstack.State.Transaction: instance [overlap ok] (Typeable st) => Serialize (GetState st)
- Happstack.State.Transaction: instance [overlap ok] (Typeable st) => Serialize (SetNewState st)
- Happstack.State.Transaction: instance [overlap ok] (Typeable st) => UpdateEvent (SetNewState st) ()
+ Happstack.State.Transaction: instance [overlap ok] Typeable st => QueryEvent (GetState st) ByteString
+ Happstack.State.Transaction: instance [overlap ok] Typeable st => Serialize (GetState st)
+ Happstack.State.Transaction: instance [overlap ok] Typeable st => Serialize (SetNewState st)
+ Happstack.State.Transaction: instance [overlap ok] Typeable st => UpdateEvent (SetNewState st) ()
- Happstack.State: catchEv :: (CatchEv m) => Ev m a -> (SomeException -> a) -> Ev m a
+ Happstack.State: catchEv :: CatchEv m => Ev m a -> (SomeException -> a) -> Ev m a
- Happstack.State: getEventId :: (Integral txId) => AnyEv txId
+ Happstack.State: getEventId :: Integral txId => AnyEv txId
- Happstack.State: getRandom :: (Random a) => AnyEv a
+ Happstack.State: getRandom :: Random a => AnyEv a
- Happstack.State: getRandomR :: (Random a) => (a, a) -> AnyEv a
+ Happstack.State: getRandomR :: Random a => (a, a) -> AnyEv a
- Happstack.State: getTime :: (Integral epochTime) => AnyEv epochTime
+ Happstack.State: getTime :: Integral epochTime => AnyEv epochTime
- Happstack.State.ComponentSystem: addItem :: (MonadState Collection m) => String -> MethodMap -> [ByteString] -> IO () -> m ()
+ Happstack.State.ComponentSystem: addItem :: MonadState Collection m => String -> MethodMap -> [ByteString] -> IO () -> m ()
- Happstack.State.ComponentSystem: initialValue :: (Component a) => a
+ Happstack.State.ComponentSystem: initialValue :: Component a => a
- Happstack.State.ComponentSystem: methods :: (Methods a) => Proxy a -> [Method a]
+ Happstack.State.ComponentSystem: methods :: Methods a => Proxy a -> [Method a]
- Happstack.State.ComponentSystem: onLoad :: (Component a) => Proxy a -> IO ()
+ Happstack.State.ComponentSystem: onLoad :: Component a => Proxy a -> IO ()
- Happstack.State.ComponentSystem: subHandlers :: (SubHandlers a) => a -> Collect ()
+ Happstack.State.ComponentSystem: subHandlers :: SubHandlers a => a -> Collect ()
- Happstack.State.Saver: createReader :: (Serialize a) => Saver -> String -> Int -> IO (ReaderStream a)
+ Happstack.State.Saver: createReader :: Serialize a => Saver -> String -> Int -> IO (ReaderStream a)
- Happstack.State.Saver: createWriter :: (Serialize a) => Saver -> String -> Int -> IO (WriterStream a)
+ Happstack.State.Saver: createWriter :: Serialize a => Saver -> String -> Int -> IO (WriterStream a)
- Happstack.State.Transaction: eventTString :: (Serialize ev) => ev -> TypeString
+ Happstack.State.Transaction: eventTString :: Serialize ev => ev -> TypeString
- Happstack.State.Transaction: extraEvents :: (Serialize st) => TxRun st -> EventMap
+ Happstack.State.Transaction: extraEvents :: Serialize st => TxRun st -> EventMap
- Happstack.State.Transaction: getEventId :: (Integral txId) => AnyEv txId
+ Happstack.State.Transaction: getEventId :: Integral txId => AnyEv txId
- Happstack.State.Transaction: getTime :: (Integral epochTime) => AnyEv epochTime
+ Happstack.State.Transaction: getTime :: Integral epochTime => AnyEv epochTime
- Happstack.State.Transaction: pushEventItem :: (Serialize ev) => TxContext -> ev -> IO ()
+ Happstack.State.Transaction: pushEventItem :: Serialize ev => TxContext -> ev -> IO ()
- Happstack.State.Transaction: quickQuery' :: (Serialize st) => TxRun st -> HR st -> IO ()
+ Happstack.State.Transaction: quickQuery' :: Serialize st => TxRun st -> HR st -> IO ()
Files
- happstack-state.cabal +1/−1
- src/Happstack/State/ComponentTH.hs +6/−6
- src/Happstack/State/Transaction.hs +2/−0
happstack-state.cabal view
@@ -1,5 +1,5 @@ Name: happstack-state-Version: 0.5.0.3+Version: 0.5.0.4 Synopsis: Event-based distributed state. Description: Unplug your machine and restart and have your app recover to exactly where it left off. Happstack-State spares you the need to deal with all the marshalling, consistency, and configuration headache that you would have if you used an external DBMS for this purpose. Its component model makes it easy to compose big applications from smaller reliable parts. Use event subscription to trigger IO actions and support comet-style or irc-bot applications. License: BSD3
src/Happstack/State/ComponentTH.hs view
@@ -217,12 +217,12 @@ _ -> error $ "Method is not a function: " ++ nameBase method ++ " is a " ++ showInfo methodInfo showInfo :: Info -> String-showInfo (ClassI _) = "class"-showInfo (TyConI _) = "type constructor"-showInfo (PrimTyConI _ _ _) = "primitive type constructor"-showInfo (DataConI _ _ _ _) = "data constructor"-showInfo (VarI _ _ _ _) = "variable"-showInfo (TyVarI _ _) = "type variable"+showInfo ClassI{} = "class"+showInfo TyConI{} = "type constructor"+showInfo PrimTyConI{} = "primitive type constructor"+showInfo DataConI{} = "data constructor"+showInfo VarI{} = "variable"+showInfo TyVarI{} = "type variable" showInfo x = pprint x
src/Happstack/State/Transaction.hs view
@@ -169,6 +169,7 @@ return $ M.union (extraEvents tx) (M.map (eventHandler tx) m) return $ M.unions maps where (componentTree, _versions, _ioActions) = collectHandlers componentProxy+ eventHandler :: Serialize st => TxRun st -> Method st -> EventHandler eventHandler tx (Update fn) = let updateCold' ev getCxt = do mv <- newEmptyMVar@@ -190,6 +191,7 @@ = do cxt <- newTxContext updateCold' ev $ addTxId tx cxt in UpdateHandler updateCold updateHot parseObject+ eventHandler tx (Query fn) = let queryEmitter ev = do mv <- newEmptyMVar