| Portability | GHC |
|---|---|
| Stability | experimental |
| Maintainer | [email protected] |
Network.BERT.Server
Contents
Description
BERT-RPC server (http://bert-rpc.org/). This implements the client RPC call/reply logic. Only synchronous requests are supported at this time.
- data DispatchResult
- serve :: Transport -> (String -> String -> [Term] -> IO DispatchResult) -> IO ()
Documentation
data DispatchResult Source
Constructors
| Success Term | |
| NoSuchModule | |
| NoSuchFunction | |
| Undesignated String |
Instances
Serve
To serve requests, create a transport and call serve with a
dispatch function.
main = do t <- fromHostPort "" 8080 serve t dispatch dispatch "calc" "add" [IntTerm a, IntTerm b] = return $ Right $ IntTerm (a + b) dispatch _ _ _ = do return $ Left "no such m/f!"