| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Admission.Bytes
Contents
Description
Byte-weighted admission for publish requests.
Synopsis
- data ByteAdmission
- newByteAdmission :: Deadlines -> Int -> IO ByteAdmission
- withByteAdmission :: MonadUnliftIO m => MetricsPort -> ByteAdmission -> Int -> m a -> m (Maybe a)
- newByteAdmissionTuned :: Deadlines -> Int -> Int -> Int -> IO ByteAdmission
Documentation
data ByteAdmission Source #
Process-wide byte capacity and bounded waiting-room state.
newByteAdmission :: Deadlines -> Int -> IO ByteAdmission Source #
Allocate byte capacity, clamped to one, with the shared wait budget timed on the deadlines.
withByteAdmission :: MonadUnliftIO m => MetricsPort -> ByteAdmission -> Int -> m a -> m (Maybe a) Source #
Hold a weight clamped to capacity. A full room or expired wait returns Nothing.
Internals exported for testing
newByteAdmissionTuned :: Deadlines -> Int -> Int -> Int -> IO ByteAdmission Source #
Set the waiting-room bound and microsecond wait budget explicitly.