bert- BERT implementation

Safe HaskellNone




Transport for BERT-RPC client. Creates a transport from a URI, leaving flexibility for several underlying transport implementations. The current one is over sockets (TCP), with the URI scheme bert, eg: bert://localhost:9000

The TCP transport will create a new connection for every request (every block of withTransport), which seems to be what the current server implementations expect. It'd be great to have persistent connections, however.



data Transport Source

Defines a transport endpoint. Create with fromURI.

fromURI :: String -> IO TransportSource

Create a transport from the given URI.

fromHostPort :: Integral a => String -> a -> IO TransportSource

Create a (TCP) transport from the given host and port

Transport monad

data TransportM a Source


withTransport :: Transport -> TransportM a -> IO aSource

Execute the given transport monad action in the context of the passed transport.

sendt :: Term -> TransportM ()Source

Send a term (inside the transport monad)

recvt :: TransportM TermSource

Receive a term (inside the transport monad)

Server side

servet :: Transport -> (Transport -> IO ()) -> IO ()Source