ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

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

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.

data MountReadiness Source #

One mount's advisory state. The flip is one-way, so a mount never falls back to awaiting.

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

data Readiness Source #

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).

Instances

Instances details
Show Readiness Source # 
Instance details

Defined in Ecluse.Core.Server.Readiness

Eq Readiness Source # 
Instance details

Defined in Ecluse.Core.Server.Readiness

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.