rpc-framework-0.3.0.0: a remote procedure call framework

PortabilityGeneralizedNewtypeDeriving, StandaloneDeriving, ScopedTypeVariables, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, FunctionalDependencies, IncoherentInstances, TypeFamilies
Stabilityexperimental
MaintainerMatthew Mirman <mmirman@andrew.cmu.edu>
Safe HaskellNone

Network.Remote.RPC.Internal.Runtime

Description

The functions for using a function as a service and calling a remote process

Synopsis

Documentation

data WIO w m a Source

WIO w m a is a newtype over a server transformer that adds the phantom host argument w

Instances

(Sendable m a' a, Sendable m b b') => Sendable m (a -> b) (a' -> WIO w m b') 
MonadTrans (WIO w) 
Monad m => Monad (WIO w m) 
Functor m => Functor (WIO w m) 
MonadIO m => MonadIO (WIO w m) 
Forkable m => Forkable (WIO w m) 
Servable m => Servable (WIO w m) 
(Host w, Servable m, Sendable m a a') => Service (WIO w m a) m w 
(Sendable m' a a', Host w, Host w', Servable m, Servable m') => RPC (WIO w m a) (WIO w' m' a') m' w' 

onHost :: forall w m. (Servable m, Host w) => w -> WIO w m ()Source

onHost declares that the code is running on the given host. it is usefull when a type inference is wanted, but the action also needs to be made into a service and used as a remote procedure

realRemoteCall :: forall a a' w m. RPC a a' m w => a -> String -> a'Source

makeService :: Service a m w => a -> String -> WIO w m ()Source

class Host a whereSource

Host World declares that the world is a host. It should only have one constructor, and the location and port should be invariant of the given constructor. Specifically, getLocation and getPort should work even if bottom is supplied.

class Servable m => Sendable m a a' | a' -> a, a m -> a', a a' -> mSource

Instances

(Read a, Show a', ~ * a a', Servable m) => Sendable m a a' 
(Sendable m a' a, Sendable m b b') => Sendable m (a -> b) (a' -> WIO w m b') 

class (Functor m, Monad m, MonadIO m, Forkable m) => Servable m Source

Servable is a declaration that the given monad can be made into a servlet.

Instances

data Ref a a' Source

Instances

Read (Ref a a') 
Show (Ref a a') 

liftIO :: MonadIO m => forall a. IO a -> m a

Lift a computation from the IO monad.

runServer :: forall w m. (Servable m, Host w) => WIO w m () -> m ()Source

runServer runs a name server and doesn't return

runServerBG :: Host w => WIO w IO () -> IO ThreadIdSource

runServerBG runs a name server on a background thread and does return