core: delete connections asynchronously (#1151)

This commit is contained in:
JRoberts
2022-09-30 16:18:43 +04:00
committed by GitHub
parent dd5e99ea42
commit 428d3cdba5
6 changed files with 120 additions and 46 deletions
+4
View File
@@ -957,6 +957,7 @@ data CommandFunction
| CFJoinConn
| CFAllowConn
| CFAckMessage
| CFDeleteConn
deriving (Eq, Show, Generic)
instance FromField CommandFunction where fromField = fromTextField_ textDecode
@@ -969,12 +970,14 @@ instance TextEncoding CommandFunction where
"join_conn" -> Just CFJoinConn
"allow_conn" -> Just CFAllowConn
"ack_message" -> Just CFAckMessage
"delete_conn" -> Just CFDeleteConn
_ -> Nothing
textEncode = \case
CFCreateConn -> "create_conn"
CFJoinConn -> "join_conn"
CFAllowConn -> "allow_conn"
CFAckMessage -> "ack_message"
CFDeleteConn -> "delete_conn"
commandExpectedResponse :: CommandFunction -> ACommandTag 'Agent
commandExpectedResponse = \case
@@ -982,6 +985,7 @@ commandExpectedResponse = \case
CFJoinConn -> OK_
CFAllowConn -> OK_
CFAckMessage -> OK_
CFDeleteConn -> OK_
data CommandData = CommandData
{ cmdId :: CommandId,