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

Portabilityportable
Stabilityexperimental
MaintainerStefan Schmidt (stefanschmidt@web.de)

Holumbus.Distribution.DNode

Description

Version : 0.1

Public interface of the DNode datatype. See Holumbus.Distribution.DNode.Base for further documentation.

Synopsis

Documentation

data DistributedException Source

The exception type, used by distributed communication

Constructors

DistributedException 

Fields

distEx_msg :: String

the message of the exception

distEx_fct :: String

the function in which the exception was thrown

distEx_mod :: String

the module in which the exception was thrown

data DNodeConfig Source

The configuration of a DNode. You need it to create a DNode and you can use this data type it to alter its properties. This type is public to allow users to create their own configuration.

Instances

defaultDNodeConfig :: String -> DNodeConfigSource

A good default configuration. To create an unnamed node, just leave the string empty.

data DNodeId Source

The DNode identifier. Every DNode has an Id, this could be named or randomly created. The id could not be used to address a DNode directly over a Network connection because the physical references are missing. The DNodeId is meant to create a declarative reference which could be used to lookup purposes. Think of the DNodeId as a domain name, without a DNS-Server to resolve the physical address, it is worthless to establish a communication.

mkDNodeId :: String -> DNodeIdSource

Use this to make a new DNodeId from a String

mkDNodeAddress :: String -> HostName -> Int -> DNodeAddressSource

use this to make a new DNodeAddress

data DHandlerId Source

The Id of a handler, is needed to stop the handler from further execution.

initDNode :: DNodeConfig -> IO DNodeIdSource

Initializes the DNode of the program. You have to call this function once BEFORE you can use other functions.

deinitDNode :: IO ()Source

deinitializes a DNode

addForeignDNode :: DNodeAddress -> IO ()Source

Add a foreign DNode to the list of known DNodes. Only DNodes in this list could be reached by the local node.

delForeignDNode :: DNodeId -> IO ()Source

removes a foreign DNode entry. You should clean up the foreign DNode entries.

checkForeignDNode :: DNodeId -> IO BoolSource

Manually Checks, if another DNode is reachable. Returns true if this is the case, otherwise false. Always returns, does not throw an exception caused by network failures.

addForeignDNodeHandler :: Bool -> DNodeId -> DHandlerFunction -> IO (Maybe DHandlerId)Source

Adds a handler function which periodically checks the existences (or non-existence) of other DNodes. The first parameter indicates the type of the handler. If you want to install a handler which is fired when a Node becomes reachable (positive trigger), it needs to be true. If you want to monitor the event when a specific node disappears, pass false.

addForeignDResourceHandler :: Bool -> DResourceAddress -> DHandlerFunction -> IO (Maybe DHandlerId)Source

Adds a handler function which periodically checks the existences (or non-existence) of resources on other DNodes. The first parameter indicates the type of the handler. If you want to install a handler which is fired when a Node becomes reachable (positive trigger), it needs to be true. If you want to monitor the event when a specific node disappears, pass false.

delForeignHandler :: DHandlerId -> IO ()Source

Deletes a Handler from the system, will not be called anymore.

getDNodeData :: IO DNodeDataSource