metro-0.1.0.2: A simple tcp and udp socket server framework

Safe HaskellNone
LanguageHaskell2010

Metro.Session

Documentation

data SessionEnv u nid k rpkt Source #

Constructors

SessionEnv 
Instances
Monad m => MonadReader (SessionEnv u nid k rpkt) (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

ask :: SessionT u nid k rpkt tp m (SessionEnv u nid k rpkt) #

local :: (SessionEnv u nid k rpkt -> SessionEnv u nid k rpkt) -> SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m a #

reader :: (SessionEnv u nid k rpkt -> a) -> SessionT u nid k rpkt tp m a #

data SessionEnv1 u nid k rpkt tp Source #

Constructors

SessionEnv1 

Fields

newSessionEnv :: MonadIO m => u -> nid -> k -> Int64 -> [Maybe rpkt] -> m (SessionEnv u nid k rpkt) Source #

data SessionT u nid k rpkt tp m a Source #

Instances
FromConn (SessionT u nid k rpkt) Source # 
Instance details

Defined in Metro.Session

Methods

fromConn :: Monad n => ConnT tp n a -> SessionT u nid k rpkt tp n a Source #

Monad m => MonadReader (SessionEnv u nid k rpkt) (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

ask :: SessionT u nid k rpkt tp m (SessionEnv u nid k rpkt) #

local :: (SessionEnv u nid k rpkt -> SessionEnv u nid k rpkt) -> SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m a #

reader :: (SessionEnv u nid k rpkt -> a) -> SessionT u nid k rpkt tp m a #

MonadTrans (SessionT u nid k rpkt tp) Source # 
Instance details

Defined in Metro.Session

Methods

lift :: Monad m => m a -> SessionT u nid k rpkt tp m a #

Monad m => Monad (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

(>>=) :: SessionT u nid k rpkt tp m a -> (a -> SessionT u nid k rpkt tp m b) -> SessionT u nid k rpkt tp m b #

(>>) :: SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m b -> SessionT u nid k rpkt tp m b #

return :: a -> SessionT u nid k rpkt tp m a #

fail :: String -> SessionT u nid k rpkt tp m a #

Functor m => Functor (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

fmap :: (a -> b) -> SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m b #

(<$) :: a -> SessionT u nid k rpkt tp m b -> SessionT u nid k rpkt tp m a #

Applicative m => Applicative (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

pure :: a -> SessionT u nid k rpkt tp m a #

(<*>) :: SessionT u nid k rpkt tp m (a -> b) -> SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m b #

liftA2 :: (a -> b -> c) -> SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m b -> SessionT u nid k rpkt tp m c #

(*>) :: SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m b -> SessionT u nid k rpkt tp m b #

(<*) :: SessionT u nid k rpkt tp m a -> SessionT u nid k rpkt tp m b -> SessionT u nid k rpkt tp m a #

MonadIO m => MonadIO (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

liftIO :: IO a -> SessionT u nid k rpkt tp m a #

MonadUnliftIO m => MonadUnliftIO (SessionT u nid k rpkt tp m) Source # 
Instance details

Defined in Metro.Session

Methods

withRunInIO :: ((forall a. SessionT u nid k rpkt tp m a -> IO a) -> IO b) -> SessionT u nid k rpkt tp m b #

runSessionT :: SessionEnv u nid k rpkt -> SessionT u nid k rpkt tp m a -> ConnT tp m a Source #

runSessionT1 :: SessionEnv1 u nid k rpkt tp -> SessionT u nid k rpkt tp m a -> m a Source #

send :: (MonadUnliftIO m, Transport tp, SendPacket spkt, SetPacketId k spkt) => spkt -> SessionT u nid k rpkt tp m () Source #

sessionState :: MonadIO m => SessionT u nid k rpkt tp m Bool Source #

feed :: MonadIO m => Maybe rpkt -> SessionT u nid k rpkt tp m () Source #

receive :: (MonadIO m, Transport tp) => SessionT u nid k rpkt tp m (Maybe rpkt) Source #

readerSize :: MonadIO m => SessionT u nid k rpkt tp m Int Source #

getSessionId :: Monad m => SessionT u nid k rpkt tp m k Source #

getNodeId :: Monad m => SessionT u nid k rpkt tp m nid Source #

getSessionEnv1 :: (Monad m, Transport tp) => SessionT u nid k rpkt tp m (SessionEnv1 u nid k rpkt tp) Source #

env :: Monad m => SessionT u nid k rpkt tp m u Source #

ident :: SessionEnv1 u nid k rpkt tp -> (nid, k) Source #

isTimeout :: MonadIO m => SessionT u nid k rpkt tp m Bool Source #

makeResponse :: (MonadUnliftIO m, Transport tp, SendPacket spkt, SetPacketId k spkt) => (rpkt -> m (Maybe spkt)) -> SessionT u nid k rpkt tp m () Source #

makeResponse_ :: (MonadUnliftIO m, Transport tp, SendPacket spkt, SetPacketId k spkt) => (rpkt -> Maybe spkt) -> SessionT u nid k rpkt tp m () Source #