Portability | GHC |
---|---|
Stability | experimental |
Maintainer | marius@monkey.org |
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
- fromURI :: String -> IO Transport
- fromHostPort :: Integral a => String -> a -> IO Transport
- data TransportM a
- withTransport :: Transport -> TransportM a -> IO a
- sendt :: Term -> TransportM ()
- recvt :: TransportM Term
- servet :: Transport -> (Transport -> IO ()) -> IO ()
Documentation
fromHostPort :: Integral a => String -> a -> IO TransportSource
Create a (TCP) transport from the given host and port
Transport monad
data TransportM a Source
Monad TransportM | |
MonadIO TransportM | |
MonadState TransportState TransportM |
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)