curryer-rpc-0.2.1: Fast, Haskell RPC
Safe HaskellNone
LanguageHaskell2010

Network.RPC.Curryer.Client

Synopsis

Documentation

data Connection Source #

Represents a remote connection to server.

data ClientAsyncRequestHandler where Source #

Function handlers run on the client, triggered by the server- useful for asynchronous callbacks.

Constructors

ClientAsyncRequestHandler :: forall a. Serialise a => (a -> IO ()) -> ClientAsyncRequestHandler 

connect :: ClientAsyncRequestHandlers -> HostAddr -> PortNumber -> IO Connection Source #

Connects to a remote server with specific async callbacks registered.

close :: Connection -> IO () Source #

Close the connection and release all connection resources.

clientAsync :: Socket -> SyncMap -> ClientAsyncRequestHandlers -> IO () Source #

async thread for handling client-side incoming messages- dispatch to proper waiting thread or asynchronous notifications handler

consumeResponse :: UUID -> Map UUID (MVar a, b) -> a -> IO () Source #

clientEnvelopeHandler :: ClientAsyncRequestHandlers -> Locking Socket -> SyncMap -> Envelope -> IO () Source #

handles envelope responses from server- timeout from ths server is ignored, but perhaps that's proper for trusted servers- the server expects the client to process all async requests

call :: (Serialise request, Serialise response) => Connection -> request -> IO (Either ConnectionError response) Source #

Basic remote function call via data type and return value.

callTimeout :: (Serialise request, Serialise response) => Maybe Int -> Connection -> request -> IO (Either ConnectionError response) Source #

Send a request to the remote server and returns a response but with the possibility of a timeout after n microseconds.

asyncCall :: Serialise request => Connection -> request -> IO (Either ConnectionError ()) Source #

Call a remote function but do not expect a response from the server.