Holumbus-Distribution-0.1.1: intra- and inter-program communication

Portabilityportable
Stabilityexperimental
MaintainerStefan Schmidt (stefanschmidt@web.de)

Holumbus.Network.PortRegistry

Contents

Description

Version : 0.1

The typeclass for the PortRegistry. Contains all PortRegistry functions which can accessed remotely by the clients.

Synopsis

Type-Classes

class PortRegistry pr whereSource

The Interface of the PortRegistry.

Methods

registerPort :: String -> SocketId -> pr -> IO ()Source

Creates a new port entry in the registry.

unregisterPort :: String -> pr -> IO ()Source

Deletes an entry from the registry.

lookupPort :: String -> pr -> IO (Maybe SocketId)Source

Get the socket of the port by its name.

getPorts :: pr -> IO [(String, SocketId)]Source

Get a list of all registered ports.

GenericRegistry

data GenericRegistry Source

The generic registry object. This is a wrapper around an PortRegistryData or PortRegistryPort object. With this additional indirection, we eliminate the distinction between the port or the data object in the datatypes using the PortRegistry. Therefore it is easier to get access to the registry and the code gets more readable. This might be a good example of hiding network-access. To the caller it makes no difference, if the PortRegistry is in the same address space of on another computer in the network.

mkGenericRegistry :: PortRegistry r => r -> GenericRegistrySource

Creates a new generic PortRegistry.