Spock-0.14.0.0: Another Haskell web framework for rapid development
Safe HaskellNone
LanguageHaskell2010

Web.Spock.Internal.SessionVault

Synopsis

Documentation

class (Eq (SessionKey s), Hashable (SessionKey s)) => IsSession s where Source #

Associated Types

type SessionKey s :: * Source #

Methods

getSessionKey :: s -> SessionKey s Source #

Instances

Instances details
IsSession (Session conn sess st) Source # 
Instance details

Defined in Web.Spock.Internal.SessionVault

Associated Types

type SessionKey (Session conn sess st) Source #

Methods

getSessionKey :: Session conn sess st -> SessionKey (Session conn sess st) Source #

newtype SessionVault s Source #

Constructors

SessionVault 

Fields

newSessionVault :: STM (SessionVault s) Source #

Create a new session vault

loadSession :: IsSession s => SessionKey s -> SessionVault s -> STM (Maybe s) Source #

Load a session

storeSession :: IsSession s => s -> SessionVault s -> STM () Source #

Store a session, overwriting any previous values

deleteSession :: IsSession s => SessionKey s -> SessionVault s -> STM () Source #

Removea session

toList :: SessionVault s -> STM [s] Source #

Get all sessions as list

filterSessions :: IsSession s => (s -> Bool) -> SessionVault s -> STM () Source #

Remove all sessions that do not match the predicate

mapSessions :: IsSession s => (s -> STM s) -> SessionVault s -> STM () Source #

Perform action on all sessions