Safe Haskell | None |
---|---|
Language | Haskell2010 |
Storage backend for serversession
using acid-state
.
In order to use this backend, just open the AcidState
. For
example:
import Control.Exception (bracket) import Data.Acid.Local (openLocalState, createCheckpointAndClose) import Web.ServerSession.Backend.Acid (AcidStorage(..), emptyState) withSessionStorage :: (AcidStorage -> IO a) -> IO a withSessionStorage = bracket (AcidStorage
<$> openLocalStateemptyState
) (createCheckpointAndClose .acidState
)
Synopsis
- newtype AcidStorage sess = AcidStorage {
- acidState :: AcidState (ServerSessionAcidState sess)
- emptyState :: ServerSessionAcidState sess
- data ServerSessionAcidState sess
Documentation
newtype AcidStorage sess Source #
Session storage backend using acid-state
.
AcidStorage | |
|
Instances
emptyState :: ServerSessionAcidState sess Source #
Empty ServerSessionAcidState
used to bootstrap the AcidState
.
data ServerSessionAcidState sess Source #
The current sessions.
Besides the obvious map from session IDs to sessions, we also maintain a map of auth IDs to session IDs. This allow us to quickly invalidate all sessions of a given user.
Instances
(Typeable sess, SafeCopy (Decomposed sess)) => SafeCopy (ServerSessionAcidState sess) Source # | We can't |
Defined in Web.ServerSession.Backend.Acid.Internal version :: Version (ServerSessionAcidState sess) # kind :: Kind (ServerSessionAcidState sess) # getCopy :: Contained (Get (ServerSessionAcidState sess)) # putCopy :: ServerSessionAcidState sess -> Contained Put # internalConsistency :: Consistency (ServerSessionAcidState sess) # objectProfile :: Profile (ServerSessionAcidState sess) # errorTypeName :: Proxy (ServerSessionAcidState sess) -> String # | |
AcidContext sess => IsAcidic (ServerSessionAcidState sess) Source # | |
Defined in Web.ServerSession.Backend.Acid.Internal acidEvents :: [Event (ServerSessionAcidState sess)] # |