Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Backend-free MessagePack RPC Client.
Synopsis
- data Config = Config {}
- type NotificationHandler = Client -> MethodName -> [Object] -> IO ()
- type RequestHandler = Client -> MessageId -> MethodName -> [Object] -> IO ()
- type Logger = String -> IO ()
- type Formatter = Message -> String
- defaultConfig :: Config
- data Backend = Backend {
- backendSend :: ByteString -> IO ()
- backendRecv :: IO ByteString
- backendClose :: IO ()
- data Client
- withClient :: Config -> Backend -> (Client -> IO a) -> IO a
- shutdown :: Client -> IO ()
- type Result = Either Object Object
- call :: Client -> MethodName -> [Object] -> IO Result
- reply :: Client -> MessageId -> Result -> IO ()
Config
Configuration for MessagePack RPC.
Config | |
|
type NotificationHandler = Client -> MethodName -> [Object] -> IO () Source #
Notification handler. The 3rd argument is response objects.
type RequestHandler = Client -> MessageId -> MethodName -> [Object] -> IO () Source #
Notification handler. The 2nd argument is message id to be used for replying. The 3rd argument is response objects.
type Logger = String -> IO () Source #
Logger type. Should print out the message passed as a first argument somewhere.
Backend
Backend IO functions. Any receiving / sending actions are performed by calling these functions.
Backend | |
|
Client
withClient :: Config -> Backend -> (Client -> IO a) -> IO a Source #
Executing the action in the 3rd argument with a Client
.
shutdown :: Client -> IO () Source #
This function cleans up the internal states including the termination of internal threads.