| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Admission.Overflow
Description
Bounded overflow ahead of the metadata gates. Each request keeps its permit and arrival order through retries. Gate signals and sweeper ticks wake requests without request timers.
Synopsis
- data Line
- newLine :: IO Line
- signalLine :: Line -> STM ()
- data Overflow
- newOverflow :: Deadlines -> Int -> IO Overflow
- newOverflowTuned :: Deadlines -> Int -> Int -> IO Overflow
- overflowWaiting :: Overflow -> IO Int
- data Attempt a
- = Entered a
- | TurnedAway Line
- | Expired Line
- attemptAfter :: Line -> Either Shed a -> Attempt a
- data Waited a
- awaitPlace :: MetricsPort -> Overflow -> Line -> IO (Attempt a) -> IO (Waited a)
A gate's line
Requests one gate turned away, oldest first. Equality identifies the gate of a final refusal.
signalLine :: Line -> STM () Source #
Wake the oldest request on the line. A gate runs it in the transaction that frees a place.
The queue
The queue in front of both gates: how many requests wait, how many may, and for how long.
newOverflow :: Deadlines -> Int -> IO Overflow Source #
A queue for the serve slots: eight places for each, and a 0.5 s wait. The deadlines must be swept.
newOverflowTuned :: Deadlines -> Int -> Int -> IO Overflow Source #
Set the cap and the microsecond wait explicitly. Both floor at zero.
overflowWaiting :: Overflow -> IO Int Source #
Requests parked on the gate lines, excluding retries and admitted callbacks.
Waiting for a place
What one try at the gates came to.
Constructors
| Entered a | It got a place, and its action ran. |
| TurnedAway Line | A gate's room was full, so the request waits on that gate's line. |
| Expired Line | It took a room place, and the room's wait ran out first. |
attemptAfter :: Line -> Either Shed a -> Attempt a Source #
Read a gate's answer, where the line is that gate's.
How a queued request ended.