{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Network.MessagePack.Server (
Method
, MethodType (..)
, MethodDocs (..)
, MethodVal (..)
, ServerT (..)
, Server
, method
, methodName
, methodDocs
, serve
, runServer
) where
import Control.Monad.Catch (MonadCatch)
import Control.Monad.IO.Unlift (MonadUnliftIO)
import Control.Monad.Trans (MonadIO)
import Control.Monad.Trans.Control (MonadBaseControl)
import Network.MessagePack.Protocol (protocolMethods)
import Network.MessagePack.Server.Basic
runServer
:: (MonadBaseControl IO m, MonadIO m, MonadCatch m, MonadUnliftIO m)
=> Int
-> [Method m]
-> m ()
runServer :: Int -> [Method m] -> m ()
runServer Int
port [Method m]
methods =
Int -> [Method m] -> m ()
forall (m :: * -> *).
(MonadBaseControl IO m, MonadIO m, MonadCatch m,
MonadUnliftIO m) =>
Int -> [Method m] -> m ()
serve Int
port ([Method m] -> [Method m]
forall (m :: * -> *).
(MonadBaseControl IO m, MonadIO m, MonadCatch m) =>
[Method m] -> [Method m]
protocolMethods [Method m]
methods)