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

Safe HaskellNone
LanguageHaskell2010

Metro.Node

Documentation

data NodeEnv u nid k rpkt Source #

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

Defined in Metro.Node

Methods

ask :: NodeT u nid k rpkt tp m (NodeEnv u nid k rpkt) #

local :: (NodeEnv u nid k rpkt -> NodeEnv u nid k rpkt) -> NodeT u nid k rpkt tp m a -> NodeT u nid k rpkt tp m a #

reader :: (NodeEnv u nid k rpkt -> a) -> NodeT u nid k rpkt tp m a #

data NodeMode Source #

Constructors

Single 
Multi 
Instances
Eq NodeMode Source # 
Instance details

Defined in Metro.Node

Show NodeMode Source # 
Instance details

Defined in Metro.Node

data SessionMode Source #

Constructors

SingleAction 
MultiAction 
Instances
Eq SessionMode Source # 
Instance details

Defined in Metro.Node

Show SessionMode Source # 
Instance details

Defined in Metro.Node

data NodeT u nid k rpkt tp m a Source #

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

Defined in Metro.Node

Methods

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

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

Defined in Metro.Node

Methods

ask :: NodeT u nid k rpkt tp m (NodeEnv u nid k rpkt) #

local :: (NodeEnv u nid k rpkt -> NodeEnv u nid k rpkt) -> NodeT u nid k rpkt tp m a -> NodeT u nid k rpkt tp m a #

reader :: (NodeEnv u nid k rpkt -> a) -> NodeT u nid k rpkt tp m a #

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

Defined in Metro.Node

Methods

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

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

Defined in Metro.Node

Methods

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

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

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

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

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

Defined in Metro.Node

Methods

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

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

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

Defined in Metro.Node

Methods

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

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

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

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

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

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

Defined in Metro.Node

Methods

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

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

Defined in Metro.Node

Methods

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

initEnv :: MonadIO m => u -> nid -> IO k -> m (NodeEnv u nid k rpkt) Source #

withEnv :: Monad m => u -> NodeT u nid k rpkt tp m a -> NodeT u nid k rpkt tp m a Source #

setNodeMode :: NodeMode -> NodeEnv u nid k rpkt -> NodeEnv u nid k rpkt Source #

setSessionMode :: SessionMode -> NodeEnv u nid k rpkt -> NodeEnv u nid k rpkt Source #

setDefaultSessionTimeout :: TVar Int64 -> NodeEnv u nid k rpkt -> NodeEnv u nid k rpkt Source #

setDefaultSessionTimeout1 :: MonadIO m => NodeEnv1 u nid k rpkt tp -> Int64 -> m () Source #

runNodeT :: NodeEnv u nid k rpkt -> NodeT u nid k rpkt tp m a -> ConnT tp m a Source #

startNodeT :: (MonadUnliftIO m, Transport tp, RecvPacket rpkt, GetPacketId k rpkt, Eq k, Hashable k) => SessionT u nid k rpkt tp m () -> NodeT u nid k rpkt tp m () Source #

startNodeT_ :: (MonadUnliftIO m, Transport tp, RecvPacket rpkt, GetPacketId k rpkt, Eq k, Hashable k) => (rpkt -> m Bool) -> SessionT u nid k rpkt tp m () -> NodeT u nid k rpkt tp m () Source #

withSessionT :: (MonadUnliftIO m, Eq k, Hashable k) => Maybe Int64 -> SessionT u nid k rpkt tp m a -> NodeT u nid k rpkt tp m a Source #

nodeState :: MonadIO m => NodeT u nid k rpkt tp m Bool Source #

stopNodeT :: (MonadIO m, Transport tp) => NodeT u nid k rpkt tp m () Source #

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

request :: (MonadUnliftIO m, Transport tp, SendPacket spkt, SetPacketId k spkt, Eq k, Hashable k) => Maybe Int64 -> spkt -> NodeT u nid k rpkt tp m (Maybe rpkt) Source #

requestAndRetry :: (MonadUnliftIO m, Transport tp, SendPacket spkt, SetPacketId k spkt, Eq k, Hashable k) => Maybe Int64 -> Maybe Int -> spkt -> NodeT u nid k rpkt tp m (Maybe rpkt) Source #

newSessionEnv :: (MonadIO m, Eq k, Hashable k) => Maybe Int64 -> k -> NodeT u nid k rpkt tp m (SessionEnv u nid k rpkt) Source #

nextSessionId :: MonadIO m => NodeT u nid k rpkt tp m k Source #

runSessionT_ :: Monad m => SessionEnv u nid k rpkt -> SessionT u nid k rpkt tp m a -> NodeT u nid k rpkt tp m a Source #

busy :: MonadIO m => NodeT u nid k rpkt tp m Bool Source #

data NodeEnv1 u nid k rpkt tp Source #

Constructors

NodeEnv1 

Fields

initEnv1 :: MonadIO m => (NodeEnv u nid k rpkt -> NodeEnv u nid k rpkt) -> ConnEnv tp -> u -> nid -> IO k -> m (NodeEnv1 u nid k rpkt tp) Source #

runNodeT1 :: NodeEnv1 u nid k rpkt tp -> NodeT u nid k rpkt tp m a -> m a Source #

getEnv1 :: (Monad m, Transport tp) => NodeT u nid k rpkt tp m (NodeEnv1 u nid k rpkt tp) Source #

getTimer :: MonadIO m => NodeT u nid k rpkt tp m Int64 Source #

getNodeId :: Monad m => NodeT n nid k rpkt tp m nid Source #

getSessionSize :: MonadIO m => NodeEnv u nid k rpkt -> m Int Source #

getSessionSize1 :: MonadIO m => NodeEnv1 u nid k rpkt tp -> m Int Source #