Safe Haskell | None |
---|---|
Language | Haskell98 |
- data ServerCommand
- data ServerOpts = ServerOpts {}
- data ClientOpts = ClientOpts {}
- data Request = Request {}
- type Msg a = (Bool, a)
- isLisp :: Lens' (Msg a) Bool
- msg :: Lens (Msg a) (Msg b) a b
- jsonMsg :: a -> Msg a
- lispMsg :: a -> Msg a
- encodeMessage :: ToJSON a => Msg (Message a) -> ByteString
- decodeMessage :: FromJSON a => ByteString -> Either (Msg String) (Msg (Message a))
- sendCommand :: ClientOpts -> Bool -> Command -> (Notification -> IO a) -> IO Result
- runServerCommand :: ServerCommand -> IO ()
- findPath :: MonadIO m => CommandOptions -> FilePath -> m FilePath
- processRequest :: SessionMonad m => CommandOptions -> Command -> m Result
- processClient :: SessionMonad m => String -> Chan ByteString -> (ByteString -> IO ()) -> m ()
- processClientSocket :: SessionMonad m => String -> Socket -> m ()
- module HsDev.Server.Types
Documentation
data ServerCommand Source #
Server control command
data ServerOpts Source #
Server options
data ClientOpts Source #
Client options
ClientOpts | |
|
encodeMessage :: ToJSON a => Msg (Message a) -> ByteString Source #
decodeMessage :: FromJSON a => ByteString -> Either (Msg String) (Msg (Message a)) Source #
Decode lisp or json request
sendCommand :: ClientOpts -> Bool -> Command -> (Notification -> IO a) -> IO Result Source #
runServerCommand :: ServerCommand -> IO () Source #
processRequest :: SessionMonad m => CommandOptions -> Command -> m Result Source #
Process request, notifications can be sent during processing
processClient :: SessionMonad m => String -> Chan ByteString -> (ByteString -> IO ()) -> m () Source #
Process client, listen for requests and process them
processClientSocket :: SessionMonad m => String -> Socket -> m () Source #
Process client by socket
module HsDev.Server.Types