Portability | portable |
---|---|
Stability | experimental |
Maintainer | Stefan 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
- type SiteMap = Map HostName (Set SiteId)
- getSiteId :: IO SiteId
- getSiteHost :: SiteId -> HostName
- getSiteProcess :: SiteId -> ProcessID
- isSameHost :: SiteId -> SiteId -> Bool
- isSameProcess :: SiteId -> SiteId -> Bool
- nearestId :: SiteId -> [SiteId] -> Maybe SiteId
- emptySiteMap :: SiteMap
- addIdToMap :: SiteId -> SiteMap -> SiteMap
- deleteIdFromMap :: SiteId -> SiteMap -> SiteMap
- deleteHostFromMap :: HostName -> SiteMap -> SiteMap
- isSiteIdMember :: SiteId -> SiteMap -> Bool
- getNeighbourSiteIds :: SiteId -> SiteMap -> Set SiteId
Datatypes
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
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
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.