-- | Stuff you can configure for a 'Session'.
data SessionConfig = SessionConfig
{
- capabilities :: ClientCapabilities, -- ^ Specific capabilities the client should advertise.
- timeout :: Int -- ^ Maximum time to wait for a request in seconds.
+ capabilities :: ClientCapabilities -- ^ Specific capabilities the client should advertise. Default is yes to everything.
+ , timeout :: Int -- ^ Maximum time to wait for a request in seconds. Defaults to 60.
}
instance Default SessionConfig where
type ParserStateReader a s r m = ConduitParser a (StateT s (ReaderT r m))
-type SessionProcessor = ConduitT FromServerMessage FromServerMessage (StateT SessionState (ReaderT SessionContext IO))
+type SessionProcessor = ConduitM FromServerMessage FromServerMessage (StateT SessionState (ReaderT SessionContext IO))
runSession :: Chan FromServerMessage -> SessionProcessor () -> SessionContext -> SessionState -> Session a -> IO (a, SessionState)
runSession chan preprocessor context state session = runReaderT (runStateT conduit state) context