ecluse:ecluse-runtime
Safe HaskellNone
LanguageGHC2021

Ecluse.Runtime.Queue.Sqs.Internal

Description

SQS queue operations with grammar-checked npm, Cargo and RubyGems identities and bounded receipt leases.

Synopsis

Configuration

data SqsConfig Source #

What the SQS backend needs. The provider knobs take their defaults from defaultSqsConfig (see Ecluse.Core.Queue).

Constructors

SqsConfig 

Fields

  • sqsQueueUrl :: Text

    The fully-qualified SQS queue URL mirror jobs are sent to and received from.

  • sqsRegion :: Text

    The AWS region the queue lives in (e.g. "us-east-1").

  • sqsEndpoint :: Maybe AwsEndpoint

    An endpoint override for an emulator or VPC endpoint. Nothing keeps amazonka's own resolution.

  • sqsBatchSize :: Int

    Maximum messages to pull per receive (SQS caps this at 10).

  • sqsWaitSeconds :: Int

    The long-poll window in seconds (SQS caps it at 20), so an idle worker does not hot-loop on empty polls.

  • sqsVisibilityTimeout :: Seconds

    How long a received message stays hidden before SQS redelivers it. extendVisibility renews it per message.

  • sqsTerminalBackoff :: Seconds

    The visibility deadLetter gives a terminal message, longer than processing so an unmirrorable artifact is not re-fetched in a hot loop.

  • sqsMaxReceiveCount :: DeliveryBudget

    The floor on deliveries before the worker retires a message. A redrive policy's higher count raises it, so a dead-letter capture is never pre-empted.

Instances

Instances details
Show SqsConfig Source # 
Instance details

Defined in Ecluse.Runtime.Queue.Sqs.Internal

Eq SqsConfig Source # 
Instance details

Defined in Ecluse.Runtime.Queue.Sqs.Internal

defaultSqsConfig :: Text -> Text -> SqsConfig Source #

A SqsConfig for a queue URL and region, with the provider knobs at their defaults.

The backend

newSqsQueue :: LogEnv -> (Text -> Either Text RegistryUrl) -> SqsConfig -> IO MirrorQueue Source #

Build an SQS-backed MirrorQueue over one amazonka env, which the handle's closures capture.

sqsQueueOver :: LogEnv -> (Text -> Either Text RegistryUrl) -> Env -> SqsConfig -> IO MirrorQueue Source #

Use an explicit AWS environment, including an endpoint supplied by a test.

Received-message lifting

data ReceivedMessage Source #

Received fields preserve SQS receipt authority separately from the untrusted body.

Constructors

ReceivedMessage 

Fields

liftReceivedMessages :: LogEnv -> (Text -> Either Text RegistryUrl) -> ReceiptLease -> [ReceivedMessage] -> IO [QueueMessage] Source #

Apply the poll's lease. Unusable messages remain unacknowledged for redelivery.

Dead-letter probe

deadLetterTerminusOf :: Maybe Text -> DeadLetterTerminus Source #

Classify redrive attachment and retain its readable delivery budget.

The queue payload's wire-name gate

mirrorJobPackage :: Ecosystem -> Maybe Text -> Text -> Either Text PackageName Source #

Read npm, Cargo and RubyGems identities through their grammars before the worker accepts them. PyPI names pass as given.