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

MaintainerStefan Schmidt (stefanschmidt@web.de)




Version : 0.1

Just a little Id to help us to decide if two thread are running in the same program or just on the same machine or on differen machines.



data SiteId Source

The datatype of the SiteId, it contains the hostname and a processid, so it is possible to decide if two site ids belong to the same process or the the same computer or are on distinct computers.

type SiteMap = Map HostName (Set SiteId)Source

Just a little Map to hold the SiteIds an to get the neighbout Ids.

Operations on the SiteId

getSiteId :: IO SiteIdSource

Gets the SiteId for the calling program.

getSiteHost :: SiteId -> HostNameSource

Extracts the Hostname from the SiteId.

getSiteProcess :: SiteId -> ProcessIDSource

Extracts the ProcessID from the SiteId.

isSameHost :: SiteId -> SiteId -> BoolSource

Test, if the two Ids are located on the same host.

isSameProcess :: SiteId -> SiteId -> BoolSource

Test, if the two Ids are located on the same host an in the same process.

nearestId :: SiteId -> [SiteId] -> Maybe SiteIdSource

Gets the nearest item from an Id-list compared to a given Id.

Operations on the SiteMap

emptySiteMap :: SiteMapSource

Empty SiteId-Map.

addIdToMap :: SiteId -> SiteMap -> SiteMapSource

Adds an id to the map.

deleteIdFromMap :: SiteId -> SiteMap -> SiteMapSource

Deletes an id from the map.

deleteHostFromMap :: HostName -> SiteMap -> SiteMapSource

Delete a hostname an all its ids from the map.

isSiteIdMember :: SiteId -> SiteMap -> BoolSource

Test, if the site id is already in the list.

getNeighbourSiteIds :: SiteId -> SiteMap -> Set SiteIdSource

Gets all ids which are on the same host, but not the original siteid itself.