Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type GroupCache = Map GroupAddress ByteString
- type GroupM = MaybeT (StateT GroupCache IO)
- execGroupM :: GroupM a -> Connection -> GroupCache -> IO GroupCache
- tryGroupM :: a -> GroupM a -> GroupM a
- tryGroupM_ :: GroupM a -> GroupM ()
- putGroup :: DatapointType a => GroupAddress -> a -> GroupM ()
- getGroup :: DatapointType a => GroupAddress -> GroupM a
- clearGroups :: GroupM ()
- uncacheGroup :: GroupAddress -> GroupM ()
Types
type GroupCache = Map GroupAddress ByteString Source
Group Cache
Execution
type GroupM = MaybeT (StateT GroupCache IO) Source
Handle cached group values
execGroupM :: GroupM a -> Connection -> GroupCache -> IO GroupCache Source
Execute a GroupM action. Changes to group values will be send to EIBd after the GroupM action has run.
tryGroupM :: a -> GroupM a -> GroupM a Source
Try to execute a GroupM action. If it fails return the given alternative value.
tryGroupM_ :: GroupM a -> GroupM () Source
Similar to "tryGroupM" but without an alternative return value.
Cache Interaction
putGroup :: DatapointType a => GroupAddress -> a -> GroupM () Source
Update a group value. The new value will be commited to the cache immediately but not to the bus. See "execGroupM" for more.
getGroup :: DatapointType a => GroupAddress -> GroupM a Source
Fetch a group value. If a group value is not cached yet, this function will silently fail and stop further instructions. Even in a case of failure, previous changes to group values will be commited to EIBd.
clearGroups :: GroupM () Source
Clear the entire cache.
uncacheGroup :: GroupAddress -> GroupM () Source
Remove one group from the cache.