| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Worker
Description
Internal to the arbiter packages. Not covered by the PVP.
Types and DDL for the arbiter_workers table.
Synopsis
- data WorkerRow = WorkerRow {
- workerId :: UUID
- queueName :: Text
- hostName :: Maybe Text
- workerCount :: Maybe Int32
- startedAt :: UTCTime
- lastHeartbeat :: UTCTime
- shuttingDown :: Bool
- paused :: Bool
- staleThresholdSecs :: Double
- metadata :: Maybe Value
- health :: WorkerHealth
- data WorkerHealth
- workerHealthToText :: WorkerHealth -> Text
- workerHealthFromText :: Text -> Either Text WorkerHealth
- arbiterWorkersTable :: SchemaName -> Text
- arbiterWorkersTableName :: Text
- createWorkersTableSQL :: SchemaName -> Text
Documentation
A row in the worker registry. One row per running worker.
Constructors
| WorkerRow | |
Fields
| |
Instances
data WorkerHealthSource #
Heartbeat-derived health of a worker. Independent of its paused flag.
Constructors
| Live | The heartbeat is fresh and the worker is not shutting down. |
| Stale | The last heartbeat is older than the worker's stale threshold. |
| Draining | The heartbeat is fresh and the worker is shutting down. |
Instances
| FromJSON WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker | |||||
| ToJSON WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker Methods toJSON :: WorkerHealth -> Value# toEncoding :: WorkerHealth -> Encoding# toJSONList :: [WorkerHealth] -> Value# toEncodingList :: [WorkerHealth] -> Encoding# omitField :: WorkerHealth -> Bool# | |||||
| Eq WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker | |||||
| Bounded WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker | |||||
| Enum WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker Methods succ :: WorkerHealth -> WorkerHealth# pred :: WorkerHealth -> WorkerHealth# toEnum :: Int -> WorkerHealth# fromEnum :: WorkerHealth -> Int# enumFrom :: WorkerHealth -> [WorkerHealth]# enumFromThen :: WorkerHealth -> WorkerHealth -> [WorkerHealth]# enumFromTo :: WorkerHealth -> WorkerHealth -> [WorkerHealth]# enumFromThenTo :: WorkerHealth -> WorkerHealth -> WorkerHealth -> [WorkerHealth]# | |||||
| Generic WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker Associated Types
| |||||
| Show WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker Methods showsPrec :: Int -> WorkerHealth -> ShowS# show :: WorkerHealth -> String# showList :: [WorkerHealth] -> ShowS# | |||||
| type Rep WorkerHealth Source # | |||||
Defined in Arbiter.Core.Worker type Rep WorkerHealth = D1 ('MetaData "WorkerHealth" "Arbiter.Core.Worker" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "Live" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Stale" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Draining" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
workerHealthToText :: WorkerHealth -> TextSource #
The health SQL token of a WorkerHealth.
workerHealthFromText :: Text -> Either Text WorkerHealthSource #
Decode the health SQL token into a WorkerHealth.
arbiterWorkersTable :: SchemaName -> TextSource #
Qualified table name for the arbiter_workers table.
arbiterWorkersTableName :: TextSource #
Bare name of the workers table, for catalog lookups by relname.
createWorkersTableSQL :: SchemaName -> TextSource #
DDL for the arbiter_workers table.