| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Readiness
Description
The verdict behind /readyz, and the per-mount advisory state it was decided from.
One configured ecosystem awaiting its advisory database does not take the whole listener out of
rotation, so a router keeps sending the healthy mounts their traffic. Only a mount whose rules
deny on the database waits for one. Readiness routes traffic and gates no request: a mount with
no advisory database refuses what needs one through its own rule policy. The constructors are
exported for matching, and mountReadiness is the sanctioned builder for a mount map, so a verdict
a producer makes agrees with its own map.
Synopsis
- data DatabaseRequirement
- data MountReadiness
- mountStateFor :: DatabaseRequirement -> Bool -> MountReadiness
- data Readiness
- mountReadiness :: Map Ecosystem MountReadiness -> Readiness
- alwaysReady :: Readiness
- routable :: Readiness -> Bool
- allMountsReady :: Readiness -> Bool
One mount's advisory state
data DatabaseRequirement Source #
Whether a mount's own rules deny on the advisory database, so it cannot decide without one.
Constructors
| DatabaseRequired | |
| DatabaseOptional |
Instances
| Show DatabaseRequirement Source # | |
Defined in Ecluse.Core.Server.Readiness Methods showsPrec :: Int -> DatabaseRequirement -> ShowS # show :: DatabaseRequirement -> String # showList :: [DatabaseRequirement] -> ShowS # | |
| Eq DatabaseRequirement Source # | |
Defined in Ecluse.Core.Server.Readiness Methods (==) :: DatabaseRequirement -> DatabaseRequirement -> Bool # (/=) :: DatabaseRequirement -> DatabaseRequirement -> Bool # | |
data MountReadiness Source #
One mount's advisory state. The flip is one-way, so a mount never falls back to awaiting.
Constructors
| MountReady | |
| MountAwaitingFirstSync |
Instances
| Show MountReadiness Source # | |
Defined in Ecluse.Core.Server.Readiness Methods showsPrec :: Int -> MountReadiness -> ShowS # show :: MountReadiness -> String # showList :: [MountReadiness] -> ShowS # | |
| Eq MountReadiness Source # | |
Defined in Ecluse.Core.Server.Readiness Methods (==) :: MountReadiness -> MountReadiness -> Bool # (/=) :: MountReadiness -> MountReadiness -> Bool # | |
mountStateFor :: DatabaseRequirement -> Bool -> MountReadiness Source #
One mount's state from what its rules need and whether its first sync has landed. A mount that only reads the database, and never denies on it, serves before any artifact is published.
The verdict
The readiness verdict, carrying the mounts it was decided from.
Constructors
| Routable (Map Ecosystem MountReadiness) | At least one configured mount is ready, or no mount is configured. |
| AwaitingMounts (Map Ecosystem MountReadiness) | Mounts are configured and none has its advisory database yet. |
| Latched | Readiness closed for good, whatever the mounts hold (the Dredger's halt latch). |
mountReadiness :: Map Ecosystem MountReadiness -> Readiness Source #
Decide the verdict from the mounts. No configured mount is routable: nothing gates routing.
alwaysReady :: Readiness Source #
The verdict of a role with no advisory mount to wait for.
Reading the verdict
routable :: Readiness -> Bool Source #
Whether /readyz answers 200. Derived from the verdict, never stored beside it.
allMountsReady :: Readiness -> Bool Source #
Whether every configured mount is ready, which for one that denies on the advisory database means it holds one. A wait condition, not the routing verdict: the Dredger holds its first sweep.