| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Admission.Internal
Contents
Description
Unit-slot admission over the shared weighted controller, and the overflow queue that both metadata gates' refusals share. The composition root builds both with the process's sweeper. A runtime built without the queue refuses a full room at once.
Synopsis
- data ServeAdmission = ServeAdmission {}
- newServeAdmission :: Deadlines -> Int -> IO ServeAdmission
- withServeAdmission :: MonadUnliftIO m => MetricsPort -> ServeAdmission -> m a -> m (Either Shed a)
- serveAdmissionLine :: ServeAdmission -> Line
- serveAdmissionOverflow :: ServeAdmission -> Maybe Overflow
- newServeAdmissionTuned :: Deadlines -> Int -> Int -> Int -> IO ServeAdmission
- withOverflow :: ServeAdmission -> Overflow -> ServeAdmission
Documentation
data ServeAdmission Source #
Process-wide serve capacity and its bounded waiting room, and the overflow queue when it is on.
Constructors
| ServeAdmission | |
Fields | |
newServeAdmission :: Deadlines -> Int -> IO ServeAdmission Source #
Allocate positive capacity, a waiting room of the same size, and an overflow queue for it. The deadlines must be swept, as the composition root's are, or a queued request never times out.
withServeAdmission :: MonadUnliftIO m => MetricsPort -> ServeAdmission -> m a -> m (Either Shed a) Source #
Hold one slot for the action, or say why the gate turned the request away.
serveAdmissionLine :: ServeAdmission -> Line Source #
The line of requests the serve slots' full room turned away.
serveAdmissionOverflow :: ServeAdmission -> Maybe Overflow Source #
The overflow queue in front of the gates, when it is on.
Internals exported for testing
newServeAdmissionTuned :: Deadlines -> Int -> Int -> Int -> IO ServeAdmission Source #
Set the waiting-room bound and microsecond wait budget explicitly, with no overflow queue.
withOverflow :: ServeAdmission -> Overflow -> ServeAdmission Source #
Put an overflow queue in front of the gates.