| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Queue.Memory
Description
The STM-backed in-memory MirrorQueue: the bounded, best-effort production backend
mirroring rolls over to when no ECLUSE_QUEUE__URL is set.
It honours the handle's contract (Ecluse.Core.Queue) with two departures. enqueue drops the
newest job past the depth cap, and a receive is final, so nothing redelivers and no delivery
carries a lease. Both are safe because the next demand re-enqueues the job.
Synopsis
- data MemoryQueueConfig = MemoryQueueConfig {}
- defaultMemoryQueueConfig :: Int -> MemoryQueueConfig
- newBoundedInMemoryQueue :: MemoryQueueConfig -> (Int -> IO ()) -> IO MirrorQueue
- memoryQueueDropReportInterval :: Int
Bounded in-memory production backend
data MemoryQueueConfig Source #
The bounded in-memory backend's depth cap and idle-poll window. Build it with
defaultMemoryQueueConfig for the production poll window.
Constructors
| MemoryQueueConfig | |
Fields
| |
Instances
| Show MemoryQueueConfig Source # | |
Defined in Ecluse.Core.Queue.Memory Methods showsPrec :: Int -> MemoryQueueConfig -> ShowS # show :: MemoryQueueConfig -> String # showList :: [MemoryQueueConfig] -> ShowS # | |
| Eq MemoryQueueConfig Source # | |
Defined in Ecluse.Core.Queue.Memory Methods (==) :: MemoryQueueConfig -> MemoryQueueConfig -> Bool # (/=) :: MemoryQueueConfig -> MemoryQueueConfig -> Bool # | |
defaultMemoryQueueConfig :: Int -> MemoryQueueConfig Source #
A MemoryQueueConfig at the production 20s idle-poll window, which sits under
workerHeartbeatStaleAfter so an idle poll cannot stall /livez.
newBoundedInMemoryQueue Source #
Arguments
| :: MemoryQueueConfig | The depth cap and the idle-poll window. |
| -> (Int -> IO ()) | Invoked on each report-worthy cap-overflow drop with the running total, for the log. |
| -> IO MirrorQueue |
Build the bounded, best-effort in-memory MirrorQueue. A cold-cache npm ci enqueues
thousands of jobs at once, so enqueue sheds past memQueueMaxDepth rather than throwing.
memoryQueueDropReportInterval :: Int Source #
How many cap-overflow drops the bounded in-memory backend absorbs between warning reports. It reports the first drop, then every multiple of this, so a sustained flood cannot spam.