implement PREPARE-FAILURE for Tobias
This commit is contained in:
parent
99413318ef
commit
054e4f17e2
4 changed files with 45 additions and 14 deletions
7
Remote/External/Types.hs
vendored
7
Remote/External/Types.hs
vendored
|
@ -14,6 +14,7 @@ module Remote.External.Types (
|
|||
ExternalLock,
|
||||
withExternalLock,
|
||||
ExternalState(..),
|
||||
PrepareStatus(..),
|
||||
parseMessage,
|
||||
Sendable(..),
|
||||
Receivable(..),
|
||||
|
@ -67,9 +68,11 @@ data ExternalState = ExternalState
|
|||
{ externalSend :: Handle
|
||||
, externalReceive :: Handle
|
||||
, externalPid :: ProcessHandle
|
||||
, externalPrepared :: Bool
|
||||
, externalPrepared :: PrepareStatus
|
||||
}
|
||||
|
||||
data PrepareStatus = Unprepared | Prepared | FailedPrepare ErrorMsg
|
||||
|
||||
-- Constructor is not exported, and only created by newExternal.
|
||||
data ExternalLock = ExternalLock
|
||||
|
||||
|
@ -124,6 +127,7 @@ instance Sendable Request where
|
|||
-- Responses the external remote can make to requests.
|
||||
data Response
|
||||
= PREPARE_SUCCESS
|
||||
| PREPARE_FAILURE ErrorMsg
|
||||
| TRANSFER_SUCCESS Direction Key
|
||||
| TRANSFER_FAILURE Direction Key ErrorMsg
|
||||
| CHECKPRESENT_SUCCESS Key
|
||||
|
@ -139,6 +143,7 @@ data Response
|
|||
|
||||
instance Receivable Response where
|
||||
parseCommand "PREPARE-SUCCESS" = parse0 PREPARE_SUCCESS
|
||||
parseCommand "PREPARE-FAILURE" = parse1 PREPARE_FAILURE
|
||||
parseCommand "TRANSFER-SUCCESS" = parse2 TRANSFER_SUCCESS
|
||||
parseCommand "TRANSFER-FAILURE" = parse3 TRANSFER_FAILURE
|
||||
parseCommand "CHECKPRESENT-SUCCESS" = parse1 CHECKPRESENT_SUCCESS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue