ecluse
Safe HaskellNone
LanguageGHC2021

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

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.

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 Ecluse.Runtime.Queue.Sqs.newSqsQueue.

MemoryBackend

The bounded in-memory backend: non-durable and best-effort, so boot warns.

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.