msgpack-rpc-conduit-0.0.7: A MessagePack-RPC Implementation
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.MessagePack.Server

Synopsis

RPC method types

data Method m Source #

class Monad m => MethodType m f where Source #

Methods

toBody :: Text -> f -> [Object] -> m Object Source #

Create a RPC method from a Haskell function

Instances

Instances details
(Functor m, MonadThrow m, MessagePack o) => MethodType m (ServerT m o) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

toBody :: Text -> ServerT m o -> [Object] -> m Object Source #

(MonadThrow m, MessagePack o, MethodType m r) => MethodType m (o -> r) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

toBody :: Text -> (o -> r) -> [Object] -> m Object Source #

newtype ServerT m a Source #

Constructors

ServerT 

Fields

Instances

Instances details
MonadTrans ServerT Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

lift :: Monad m => m a -> ServerT m a #

(Functor m, MonadThrow m, MessagePack o) => MethodType m (ServerT m o) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

toBody :: Text -> ServerT m o -> [Object] -> m Object Source #

Monad m => Monad (ServerT m) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

(>>=) :: ServerT m a -> (a -> ServerT m b) -> ServerT m b #

(>>) :: ServerT m a -> ServerT m b -> ServerT m b #

return :: a -> ServerT m a #

Functor m => Functor (ServerT m) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

fmap :: (a -> b) -> ServerT m a -> ServerT m b #

(<$) :: a -> ServerT m b -> ServerT m a #

MonadFail m => MonadFail (ServerT m) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

fail :: String -> ServerT m a #

Applicative m => Applicative (ServerT m) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

pure :: a -> ServerT m a #

(<*>) :: ServerT m (a -> b) -> ServerT m a -> ServerT m b #

liftA2 :: (a -> b -> c) -> ServerT m a -> ServerT m b -> ServerT m c #

(*>) :: ServerT m a -> ServerT m b -> ServerT m b #

(<*) :: ServerT m a -> ServerT m b -> ServerT m a #

MonadIO m => MonadIO (ServerT m) Source # 
Instance details

Defined in Network.MessagePack.Server.Basic

Methods

liftIO :: IO a -> ServerT m a #

Build a method

method Source #

Arguments

:: MethodType m f 
=> Text

Method name

-> MethodDocs 
-> f

Method body

-> Method m 

Build a method

Start RPC server

serve Source #

Arguments

:: (MonadBaseControl IO m, MonadIO m, MonadCatch m, MonadUnliftIO m) 
=> Int

Port number

-> [Method m]

list of methods

-> m () 

Start RPC server with a set of RPC methods.

runServer Source #

Arguments

:: (MonadBaseControl IO m, MonadIO m, MonadCatch m, MonadUnliftIO m) 
=> Int

Port number

-> [Method m]

list of methods

-> m () 

Start RPC server with a set of RPC methods.