Commit 79a25c7b authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Instance JSON ClientType

Make ClientType a JSON instance, in the way lock owners are
already encoded in JSON on the Python side.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarPetr Pudlak <>
parent caa39a5d
......@@ -195,6 +195,12 @@ data ClientType = ClientOther String
| ClientJob JobId
deriving (Ord, Eq, Show)
instance J.JSON ClientType where
showJSON (ClientOther s) = J.showJSON s
showJSON (ClientJob jid) = J.showJSON jid
readJSON (J.JSString s) = J.Ok . ClientOther $ J.fromJSString s
readJSON jids = J.readJSON jids >>= \jid -> J.Ok (ClientJob jid)
-- | A client is identified as a job id, thread id and path to its process
-- identifier file.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment