summaryrefslogtreecommitdiff
path: root/Omni/Agent/Core.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Agent/Core.hs')
-rw-r--r--Omni/Agent/Core.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/Omni/Agent/Core.hs b/Omni/Agent/Core.hs
index 394b357..2d09e39 100644
--- a/Omni/Agent/Core.hs
+++ b/Omni/Agent/Core.hs
@@ -11,22 +11,27 @@ import Data.Aeson (FromJSON, ToJSON)
data WorkerStatus
= Idle
| Syncing
- | Working Text -- ^ Task ID
- | Submitting Text -- ^ Task ID
- | Error Text -- ^ Error message
+ | -- | Task ID
+ Working Text
+ | -- | Task ID
+ Submitting Text
+ | -- | Error message
+ Error Text
deriving (Show, Eq, Generic)
instance ToJSON WorkerStatus
+
instance FromJSON WorkerStatus
-- | Representation of a worker agent
data Worker = Worker
- { workerName :: Text
- , workerPid :: Maybe Int
- , workerStatus :: WorkerStatus
- , workerPath :: FilePath
+ { workerName :: Text,
+ workerPid :: Maybe Int,
+ workerStatus :: WorkerStatus,
+ workerPath :: FilePath
}
deriving (Show, Eq, Generic)
instance ToJSON Worker
+
instance FromJSON Worker