| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Composition.MirrorQueue
Description
The composition root's mirror-queue backend selection: the pure decision of which queue this binary builds, and the boot warnings the choice warrants.
planMirrorQueue is the single place that knows which backends this binary can build. Failures
aggregate as BootErrors, so one run reports every missing input.
Synopsis
- data MirrorRuntimePlan
- planMirrorRuntime :: AmbientAws -> Config -> Either [BootError] MirrorRuntimePlan
- data MirrorQueuePlan
- = SqsBackend SqsConfig
- | MemoryBackend
- planMirrorQueue :: AmbientAws -> AppConfig -> Either [BootError] MirrorQueuePlan
- mirrorQueuePlanWarning :: MirrorQueuePlan -> Maybe Text
- memoryQueueBootWarning :: Text
- memoryQueueDropWarning :: Int -> Text
- deadLetterTerminusWarning :: MirrorQueuePlan -> DeliveryBudget -> Either TransportFault DeadLetterTerminus -> Maybe Text
Documentation
data MirrorRuntimePlan Source #
Whether this deployment runs a mirror runtime at all. A serve-only deployment never consults the queue configuration, so it boots with no queue variables set.
Constructors
| NoMirroring | No mount mirrors: no queue, no enqueue buffer, no worker. |
| MirrorWith MirrorQueuePlan | At least one mount mirrors: build the planned queue backend. |
Instances
| Show MirrorRuntimePlan Source # | |
Defined in Ecluse.Composition.MirrorQueue Methods showsPrec :: Int -> MirrorRuntimePlan -> ShowS # show :: MirrorRuntimePlan -> String # showList :: [MirrorRuntimePlan] -> ShowS # | |
| Eq MirrorRuntimePlan Source # | |
Defined in Ecluse.Composition.MirrorQueue Methods (==) :: MirrorRuntimePlan -> MirrorRuntimePlan -> Bool # (/=) :: MirrorRuntimePlan -> MirrorRuntimePlan -> Bool # | |
planMirrorRuntime :: AmbientAws -> Config -> Either [BootError] MirrorRuntimePlan Source #
Decide whether the composition root builds a mirror runtime at all. A serve-only deployment cannot fail boot over queue variables it does not need.
data MirrorQueuePlan Source #
Which mirror-queue backend the composition root builds. The plan carries no sizes: the in-memory backend's depth cap is a memory-plan tenant, allocated after this choice.
Constructors
| SqsBackend SqsConfig | The durable AWS SQS backend, built by |
| MemoryBackend | The bounded in-memory backend: non-durable and best-effort, so boot warns. |
Instances
| Show MirrorQueuePlan Source # | |
Defined in Ecluse.Composition.MirrorQueue Methods showsPrec :: Int -> MirrorQueuePlan -> ShowS # show :: MirrorQueuePlan -> String # showList :: [MirrorQueuePlan] -> ShowS # | |
| Eq MirrorQueuePlan Source # | |
Defined in Ecluse.Composition.MirrorQueue Methods (==) :: MirrorQueuePlan -> MirrorQueuePlan -> Bool # (/=) :: MirrorQueuePlan -> MirrorQueuePlan -> Bool # | |
planMirrorQueue :: AmbientAws -> AppConfig -> Either [BootError] MirrorQueuePlan Source #
Select the mirror-queue backend from ECLUSE_QUEUE__URL's derived shape, which an AWS_ENDPOINT_URL_SQS override overrules.
The generic AWS_ENDPOINT_URL is the S3 advisory client's, and honouring it here would redirect queue traffic.
mirrorQueuePlanWarning :: MirrorQueuePlan -> Maybe Text Source #
The loud boot warning a MirrorQueuePlan warrants, or Nothing for a durable
backend. The composition root logs the Just at WarningS when it selects the plan.
memoryQueueBootWarning :: Text Source #
The boot warning for a rollover to the in-memory queue (no ECLUSE_QUEUE__URL).
memoryQueueDropWarning :: Int -> Text Source #
The cap-overflow drop warning for the in-memory backend. The queue rate-limits this report, so it does not fire once per dropped job.
deadLetterTerminusWarning :: MirrorQueuePlan -> DeliveryBudget -> Either TransportFault DeadLetterTerminus -> Maybe Text Source #
The warning a built queue's dead-letter probe warrants, or Nothing: the memory backend is silent, memoryQueueBootWarning covering it.
Pass the built handle's budget, not the plan's configured floor, so the warning states what the worker will do.