Portability | portable |
---|---|
Stability | experimental |
Maintainer | Stefan Schmidt (stefanschmidt@web.de) |
Version : 0.1
This module contains all message types which are exchanged between node and Controller.
- type NodeId = Int
- data ControllerRequestMessage
- = CReqContains FileId
- | CReqGetFileSites FileId
- | CReqGetNearestNodePortWithFile FileId SiteId
- | CReqGetNearestNodePortWithFiles [FileId] SiteId
- | CReqGetNearestNodePortForFile FileId Integer SiteId
- | CReqGetNearestNodePortForFiles [(FileId, Integer)] SiteId
- | CReqCreate FileId NodeId
- | CReqCreateS [(FileId, NodeId)]
- | CReqAppend FileId NodeId
- | CReqDelete FileId NodeId
- | CReqUnknown
- data ControllerResponseMessage
- data NodeRequestMessage
- data NodeResponseMessage
- performPortAction :: (Show a, Binary a, Show b, Binary b, RspMsg b) => Port a -> Stream b -> Int -> a -> (b -> IO (Maybe c)) -> IO c
- type ClientPortMap = [(ClientPort, [FileId])]
Datatypes
Message Types from and to the Controller
data ControllerRequestMessage Source
Requests datatype, which is send to a filesystem Controller.
data ControllerResponseMessage Source
Response datatype from a filesystem Controller.
Message Types from and to the Node
data NodeRequestMessage Source
Requests datatype, which is send to a filesystem node.
data NodeResponseMessage Source
Response datatype from a filesystem node.
request an response handling
:: (Show a, Binary a, Show b, Binary b, RspMsg b) | |
=> Port a | request port |
-> Stream b | response Stream |
-> Int | timeout for the response in mikroseconds (1000000 = 1 sec) (0 = wait for ever) |
-> a | request message |
-> (b -> IO (Maybe c)) | response handler |
-> IO c |
Sends a request to the server (stream) and handles the response and all error cases. Very helpful when simulating a request response scheme with the mailboxes.
type ClientPortMap = [(ClientPort, [FileId])]Source